33#include "../Headers/CADEntityStreamer.h"
34#include "../Headers/CADHandleManager.h"
35#include "../Headers/DXFValueManager.h"
36#include "../Headers/EntityCodes.h"
37#include <NDEVR/DesignObjectLookup.h>
38#include <NDEVR/Geometry.h>
39#include <NDEVR/Model.h>
40#include <NDEVR/ArcShape.h>
41#include <NDEVR/ShapeConstructors.h>
42#include <NDEVR/Text.h>
43#include <NDEVR/MatrixFunctions.h>
44#include <NDEVR/FactoryOptions.h>
45#include <NDEVR/RWLock.h>
46#include <NDEVR/ACIColor.h>
47#include <NDEVR/Translator.h>
48#include <NDEVR/UnitDefinitions.h>
62 case 3:
return UnitDefinitions::InternationalMiles();
break;
63 case 8:
return UnitDefinitions::Microinches();
break;
64 case 9:
return UnitDefinitions::Mils();
break;
65 case 11:
return UnitDefinitions::Angstrom();
break;
66 case 12:
return UnitDefinitions::Nanometers();
break;
67 case 13:
return UnitDefinitions::Microns();
break;
68 case 14:
return UnitDefinitions::Decimeters();
break;
69 case 15:
return UnitDefinitions::Dekameters();
break;
70 case 16:
return UnitDefinitions::Hectometers();
break;
71 case 17:
return UnitDefinitions::Gigameters();
break;
72 case 18:
return UnitDefinitions::AstronomicalUnits();
break;
73 case 19:
return UnitDefinitions::LightYears();
break;
74 case 20:
return UnitDefinitions::Parsecs();
break;
138 class CADMeshVertexAttributeSetter;
139 class CADMeshVertexColorSetter;
144 class EntityConverter :
public CADEntityStreamer
148 virtual ~EntityConverter();
150 void setupEntityMaterial(
Model model);
151 void endFaceSection();
152 void endSection()
final override;
155 void addLayer(
const LayerData& layer)
final override;
157 Scene viewportRoot();
160 void addXRecord(
const HandleData& record)
override;
167 virtual void addLinetypeDash(
double)
override;
170 virtual void addGroup(
const DXFGroup& group_info)
override;
171 virtual void addBlock(
const BlockData& block_info)
override;
172 virtual void addViewport(
const ViewportData& block_info)
override;
173 virtual void endBlock(
const uint04&)
override;
174 void setupColorForGeoVertices();
175 virtual void addTextStyle(
const StyleData& text_style)
override;
176 virtual void addPoint(
const PointData& point)
override;
177 void addLine(
const LineData& line)
override;
178 void addXLine(
const LineData& line)
override;
179 void addRay(
const LineData& ray)
override;
180 virtual void addTrace(
const TraceData& data)
override;
181 virtual void add3dFace(
const TraceData& data)
override;
182 void addArc(
const ArcData& arc)
override;
184 void addAttribute(
const Attrib& attribute)
override;
185 void addAttributeDefinition(
const Attrib& attribute)
override;
186 Text createFromTextData(
const TextData& data,
bool is_m_text);
187 virtual void addText(
const TextData& data)
override;
190 virtual void addEllipse(
const EllipseData& e)
override;
191 virtual void addPolyline(
const PolylineData& poly)
override;
192 virtual void addMesh(
CADMeshData& mesh_data)
override;
195 virtual void addInsert(
const BlockInsert& data)
override;
196 virtual void addSpline(
const SplineData&)
override;
197 #if NDEVR_VIEWPORT && NDEVR_MEASURE_MODELS
206 virtual void addLeader(
const LeaderData& data)
override;
207 virtual void addComment(
const StringView& comment)
override;
209 void setupTextData(Text& text,
const TextData& data,
const Font& default_font,
bool is_m_text);
211 virtual void endEntity()
override;
217 Model currentBlock();
221 Model currentEntity();
222 void setVariableInt(
const StringView& label,
int value,
int key_label)
override;
223 Model& currentLinework();
227 Model& currentPoint();
235 void setGroupImport(
bool group_import);
236 void setTextFacingCamera(
bool text_face_camera);
237 void setAutoNameObjects(
bool auto_name_objects);
238 void setPointMode(NDEVRFilePointMode mode);
239 void setLineMode(DXFLineMode mode);
240 void setIgnoreKnownBlocks(
bool ignore_known_blocks);
241 void setIgnoreKnownMaterials(
bool ignore_known_materials);
244 void _addLayer(
const LayerData& layer_data);
245 void setupLayer(
Model& model);
278 String m_current_block_name;
279 String m_last_x_data_label;
280 File m_relative_path;
293 UUID m_core_root = Constant<UUID>::Invalid;
294 UUID m_current_paper_root = Constant<UUID>::Invalid;
295 UUID m_current_viewport_root = Constant<UUID>::Invalid;
296 UUID m_blocks_root = Constant<UUID>::Invalid;
297 UUID m_current_block = Constant<UUID>::Invalid;
298 UUID m_current_entity = Constant<UUID>::Invalid;
299 UUID m_current_material = Constant<UUID>::Invalid;
300 UUID m_last_insert = Constant<UUID>::Invalid;
302 Model m_current_linework;
306 Model m_current_point;
307 NDEVRFilePointMode m_point_mode = NDEVRFilePointMode::e_point;
308 DXFLineMode m_line_mode = DXFLineMode::e_line;
311 CADMeshVertexAttributeSetter* m_mesh_attribute_setter =
nullptr;
312 CADMeshVertexColorSetter* m_mesh_color_setter =
nullptr;
316 fltp08 m_next_bulge = Constant<fltp08>::Invalid;
317 uint04 m_circle_count = 0U;
318 uint04 m_ellipse_count = 0U;
319 uint04 m_insert_count = 0U;
320 uint04 m_attribute_count = 0U;
322 DXFMode m_current_mode = DXFMode::e_none;
323 bool m_color_by_vertex =
false;
324 bool m_group_import =
true;
325 bool m_text_face_camera =
false;
326 bool m_auto_name_objects =
true;
327 bool m_ignore_known_blocks =
true;
328 bool m_ignore_known_materials =
false;
329 bool m_ignore_current =
false;
The equivelent of std::vector but with a bit more control.
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
DXF Style attributes that can be applied to CAD Entity objects.
DXF streams store data in a large numbered index structure.
A core class where all Design Objects including models, materials, and geometries are stored.
A hash-based key-value store, useful for quick associative lookups.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
logic for storing a extrusion data in a CAD-friendly way for exporting and importing.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Information for how to display text data.
A core class within the model hierarchy containing vertex-based data (Usually 3D data) within a set c...
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Templated logic for doing matrix multiplication.
A core class that represents a node on model hierarchy.
Used with InfoPipe to signal that the system will be using progress.
The root Model that is responsible for storing the underlying data for all Scene Models.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
static const ConstPointer< Unit > & Feet()
Gets the unit definition for feet.
static const ConstPointer< Unit > & Meters()
Gets the unit definition for meters.
static const ConstPointer< Unit > & Kilometers()
Gets the unit definition for kilometers.
static const ConstPointer< Unit > & Millimeters()
Gets the unit definition for millimeters.
static const ConstPointer< Unit > & Degrees()
Angle Units.
static const ConstPointer< Unit > & Centimeters()
Gets the unit definition for centimeters.
static const ConstPointer< Unit > & Yards()
Gets the unit definition for yards.
static const ConstPointer< Unit > & Inches()
Gets the unit definition for inches.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
A point in N-dimensional space, used primarily for spatial location information.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
static ConstPointer< Unit > ConvertFromCADUnit(uint04 cad_unit)
Converts from a given CAD index unit.
double fltp08
Defines an alias representing an 8 byte floating-point number.
logic for storing an angular dimension in a CAD-friendly way for exporting and importing.
logic for storing a arc data in a CAD-friendly way for exporting and importing.
Logic for storing attribute data in a CAD-friendly way for exporting and importing.
A block structure (Similar to a Model) used to share data with CAD.
Information for how to place a CAD block within a scene (Similar to Model).
A container for information pointing to a CAD dictionary in CAD memory.
Stores mesh data in a way optimized for CAD.
logic for storing a circle data in a CAD-friendly way for exporting and importing.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
A type of entity in CAD representing several entities grouped together.
A DXF friendly material class which contains UV properties similar to a Material object.
logic for storing an diametric dimension in a CAD-friendly way for exporting and importing.
A CAD measurement similar to AngleMeasurementModel.
logic for storing an ordinate dimension in a CAD-friendly way for exporting and importing.
Options for CAD dimension objects.
fltp08 dimension_scale_factor
Overall scale factor for dimensions.
ConstPointer< Unit > angle_unit
The unit used for angular dimensions.
ConstPointer< Unit > distance_unit
The unit used for distance dimensions.
String arrow_block_name
Name of the block used for dimension arrows.
uint04 angle_min_decimals
Minimum decimal places for angle display.
DimensionMode
Display modes for CAD dimension text.
@ e_fractional_stacked
Stacked fractional format.
@ e_ngineering
Engineering notation.
@ e_architectural_stacked
Stacked architectural format.
@ e_decimal
Decimal notation.
@ e_architectural
Architectural format.
@ e_fractional
Fractional format.
@ e_scientific
Scientific notation.
DimensionMode display_mode
The dimension text display mode.
char decimal_seperator
The decimal separator character.
fltp08 arrow_size
Arrow size for dimension lines.
Stores Ellipse information for interfacing with CAD.
An entity in CAD which has a layer and other handle information.
A handle used to reference an object in CAD.
Layer information shared with CAD.
logic for storing a leader in a CAD-friendly way for exporting and importing.
A CAD-friendly way to store line segment information.
information for a type of line in CAD
A CAD measurement similar to DistanceMeasurementModel.
Point data stored in a friendly way for interfacing with CAD.
logic for storing a polyline data in a CAD-friendly way for exporting and importing.
logic for storing a radial dimension in a CAD-friendly way for exporting and importing.
logic for storing a spline data in a CAD-friendly way for exporting and importing.
logic for storing a style data in a CAD-friendly way for exporting and importing.
logic for storing a text data in a CAD-friendly way for exporting and importing.
logic for storing a trace data in a CAD-friendly way for exporting and importing.
logic for storing a viewport in a CAD-friendly way for exporting and importing.