53 static ConstPointer<Unit> ConvertFromCADUnit(
uint04 cad_unit)
57 case 0:
return ConstPointer<Unit>();
61 case 3:
return UnitDefinitions::InternationalMiles();
break;
62 case 8:
return UnitDefinitions::Microinches();
break;
63 case 9:
return UnitDefinitions::Mils();
break;
64 case 11:
return UnitDefinitions::Angstrom();
break;
65 case 12:
return UnitDefinitions::Nanometers();
break;
66 case 13:
return UnitDefinitions::Microns();
break;
67 case 14:
return UnitDefinitions::Decimeters();
break;
68 case 15:
return UnitDefinitions::Dekameters();
break;
69 case 16:
return UnitDefinitions::Hectometers();
break;
70 case 17:
return UnitDefinitions::Gigameters();
break;
71 case 18:
return UnitDefinitions::AstronomicalUnits();
break;
72 case 19:
return UnitDefinitions::LightYears();
break;
73 case 20:
return UnitDefinitions::Parsecs();
break;
81 default:
lib_assert(
false,
"Unknown unit");
return ConstPointer<Unit>();
136 class CADMeshVertexAttributeSetter;
137 class CADMeshVertexColorSetter;
182 Text createFromTextData(
const TextData& data);
193 #if NDEVR_VIEWPORT && NDEVR_MEASURE_MODELS
205 void setupTextData(Text& text,
const TextData& data);
235 void _addLayer(
const LayerData& layer_data);
236 void setupLayer(
Model& model);
261 String m_last_x_data_label;
265 String m_current_block_name;
275 UUID m_current_paper_root;
277 UUID m_current_block;
278 UUID m_current_entity;
284 UUID m_current_material;
298 DXFMode m_current_mode;
299 bool m_read_paper_space =
false;
300 bool m_color_by_vertex =
false;
301 bool m_group_import =
true;
302 bool m_text_face_camera =
false;
303 bool m_auto_name_objects =
true;
304 bool m_ignore_known_blocks =
true;
305 bool m_ignore_known_materials =
true;
306 bool m_ignore_current =
false;
309 uint04 m_circle_count = 0;
310 uint04 m_ellipse_count = 0;
311 uint04 m_insert_count = 0;
312 uint04 m_attribute_count = 0;
313 CADMeshVertexAttributeSetter* m_mesh_attribute_setter =
nullptr;
314 CADMeshVertexColorSetter* m_mesh_color_setter =
nullptr;
315 File m_relative_path;
#define lib_assert(expression, message)
Definition LibAssert.h:61
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A base-class for streaming out CAD entities from a file or CAD program memory.
Definition CADEntityStreamer.h:45
virtual void addDimAlign(const DimAlignedData &)
Definition CADEntityStreamer.h:85
virtual void addDimLinear(const LinearDimension &)
Definition CADEntityStreamer.h:86
virtual void addAttribute(const Attrib &)
Definition CADEntityStreamer.h:66
virtual void addText(const TextData &)
Definition CADEntityStreamer.h:84
virtual void addAttributeDefintion(const Attrib &)
Definition CADEntityStreamer.h:67
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition GraphicsPipeline.h:42
DXF Style attributes that can be applied to CAD Entity objects.
Definition DXFAttributes.h:42
DXF streams store data in a large numbered index structure. This class optimally stores this data so ...
Definition DXFValueManager.h:46
A core class where all Design Objects including models, materials, and geometries are stored....
Definition DesignObjectLookup.h:65
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
Primary class responsible for converting CAD entities into native CAD entities. If specified can merg...
Definition EntityConverter.h:143
void addDictionary(const CADDictionaryObject &dictionary) override
Geometry createGeometry()
const Buffer< UUID > & lineworkRead() const
virtual void addIndex(const Vector< 4, sint04 > &vertex) override
EntityConverter(const File &relative_path, DesignObjectLookup *lookup, ProgressInfo *logger)
Geometry & currentTriMesh()
virtual void addLinetypeDash(double) override
void addDXFMaterial(DXFMaterial &mat) override
Buffer< UUID > getAllReadEntities() const
void addLayer(const LayerData &layer) final override
void setGroupImport(bool group_import)
virtual void endBlock(const uint04 &) override
Geometry & currentPolyMesh()
const ConstPointer< Unit > & unit() const
void setVariableInt(const String &label, int value, int key_label) override
Geometry currentLinework()
virtual ~EntityConverter()
void setExtrusion(fltp08 dx, fltp08 dy, fltp08 dz, fltp08 elevation) override
void setupEntityMaterial(Model model)
void copyBlock(Model &model, Model &block)
virtual void addSpline(const SplineData &) override
void addXRecord(const HandleData &record) override
void setHandleManager(const DynamicPointer< CADHandleManager > &handle_manager)
void setupColorForGeoVertices()
virtual void addGroup(const DXFGroup &group_info) override
void addBulge(Geometry &geo, fltp08 bulge, const Vertex< 3, fltp08 > &p1, const Vertex< 3, fltp08 > &p2)
Buffer< TextBlock > parseString(const String &text, fltp08 default_height)
Buffer< Model > modelRoots() const
void addXRecordData(uint04 value, DXFValueManager *value_manager) override
virtual void addBlock(const BlockData &block_info) override
virtual void addTextStyle(const StyleData &text_style) override
void addXLine(const LineData &line) override
virtual void add3dFace(const TraceData &data) override
void setAutoNameObjects(bool auto_name_objects)
void addLine(const LineData &line) override
Extrusion & getExtrusion()
Model getLayer(const String &layer_name)
void setIgnoreKnownBlocks(bool ignore_known_blocks)
void addRay(const LineData &ray) override
void addDimRadial(const RadialDimension &) override
virtual void addPolyline(const PolylineData &poly) override
virtual void addLeader(const LeaderData &data) override
virtual void addLinetype(const LineTypeData &) override
void addDimDiametric(const DiametricDimension &) override
void addDimOrdinate(const DimOrdinateData &) override
Model getBlockModel(const String &block_name)
void addCircle(const CircleData &c) override
virtual void addPoint(const PointData &point) override
Material generateNewMaterial()
virtual void addVertex(const Vector< 4, fltp08 > &vertex) override
virtual void addTrace(const TraceData &data) override
void endSection() final override
const Buffer< UUID > & meshesRead() const
virtual void endEntity() override
void addDimAngular(const AngularDimensionData< 3 > &) override
virtual void addComment(const String &comment) override
void setTextFacingCamera(bool text_face_camera)
void addArc(const ArcData &arc) override
virtual void addEllipse(const EllipseData &e) override
const Buffer< UUID > & pointsRead() const
void setAttributes(const DXFAttributes &) override
static Matrix< fltp08 > GetOrientation(const Vector< 3, fltp08 > &extrusion)
void addDimAngular(const AngularDimensionData< 4 > &) override
virtual void addInsert(const BlockInsert &data) override
String convertFromCADName(const String &file_name, const TranslatedString &object_type, uint04 object_count)
virtual void addMesh(CADMeshData &mesh_data) override
logic for storing a extrusion data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:1055
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
A core class within the model heirarchy containing vertex-based data (Usually 3D data) within a set c...
Definition Geometry.h:64
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Definition Material.h:51
Definition Matrix.hpp:176
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
The root Model that is responsible for storing the underlying data for all Scene Models.
Definition Model.h:492
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
static ConstPointer< Unit > Inches()
static ConstPointer< Unit > Centimeters()
static ConstPointer< Unit > Millimeters()
static ConstPointer< Unit > Kilometers()
static ConstPointer< Unit > Yards()
static ConstPointer< Unit > Degrees()
Angle Units.
static ConstPointer< Unit > Meters()
static ConstPointer< Unit > Feet()
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
A vertex or point. A specific type of Vector used primarily for spacial location information.
Definition Vertex.hpp:48
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
logic for storing an angular dimension in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:657
logic for storing a arc data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:297
logic for storing a attribue data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:470
A block structure (Similar to a Model) used to share data with CAD.
Definition CADEntities.h:196
Information for how to place a CAD block within a scene (Similar to Model).
Definition CADEntities.h:528
A container for information pointing to a CAD dictionary in CAD memory.
Definition CADEntities.h:614
Stores mesh data in a way optimized for CAD.
Definition CADEntities.h:379
logic for storing a circle data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:487
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
A type of entity in CAD representing several entities grouped together.
Definition CADEntities.h:1031
A DXF friendly material class which contains UV properties similar to a Material object.
Definition CADEntities.h:1015
logic for storing an diametric dimension in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:643
A CAD measurement similar to AngleMeasurementModel.
Definition CADEntities.h:589
logic for storing an ordinate dimension in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:680
Options for CAD dimension objects.
Definition EntityConverter.h:115
char decimal_seperator
Definition EntityConverter.h:133
String arrow_block_name
Definition EntityConverter.h:134
ConstPointer< Unit > angle_unit
Definition EntityConverter.h:127
ConstPointer< Unit > distance_unit
Definition EntityConverter.h:129
fltp08 dimension_scale_factor
Definition EntityConverter.h:132
fltp08 arrow_size
Definition EntityConverter.h:131
uint04 angle_min_decimals
Definition EntityConverter.h:128
DimensionMode
Definition EntityConverter.h:117
@ e_decimal
Definition EntityConverter.h:119
@ e_fractional_stacked
Definition EntityConverter.h:122
@ e_fractional
Definition EntityConverter.h:124
@ e_architectural_stacked
Definition EntityConverter.h:121
@ e_ngineering
Definition EntityConverter.h:120
@ e_scientific
Definition EntityConverter.h:118
@ e_architectural
Definition EntityConverter.h:123
DimensionMode display_mode
Definition EntityConverter.h:130
Stores Ellipse information for interfacing with CAD.
Definition CADEntities.h:496
An entity in CAD which has a layer and other handle information.
Definition CADEntities.h:158
Information for how to display text data.
Definition Font.h:46
A handle used to reference an object in CAD.
Definition CADEntities.h:148
Layer information shared with CAD.
Definition CADEntities.h:175
logic for storing a leader in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:696
A CAD-friendly way to store line segment information.
Definition CADEntities.h:509
information for a type of line in CAD
Definition CADEntities.h:218
A CAD measurement similar to DistanceMeasurementModel.
Definition CADEntities.h:600
Point data stored in a friendly way for interfacing with CAD.
Definition CADEntities.h:539
logic for storing a polyline data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:317
logic for storing a radial dimension in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:630
logic for storing a spline data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:362
logic for storing a style data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:245
logic for storing a text data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:451
logic for storing a trace data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:349
A definition of how to describe and display data. Units can be of any type.
Definition Unit.h:36