API Documentation
Loading...
Searching...
No Matches
EntityConverter Class Reference

#include <EntityConverter.h>

Inheritance diagram for EntityConverter:
[legend]
Collaboration diagram for EntityConverter:
[legend]

Public Member Functions

 EntityConverter (const File &relative_path, DesignObjectLookup *lookup, ProgressInfo *logger)
 
void setHandleManager (const DynamicPointer< CADHandleManager > &handle_manager)
 
virtual ~EntityConverter ()
 
void setupEntityMaterial (Model model)
 
void endFaceSection ()
 
void endSection () final override
 
const ConstPointer< Unit > & unit () const
 
Material getMaterial ()
 
void addLayer (const LayerData &layer) final override
 
void _addLayer (const LayerData &layer_data)
 
String convertFromCADName (const String &file_name, const TranslatedString &object_type, uint04 object_count)
 
void addDictionary (const CADDictionaryObject &dictionary) override
 
void addXRecord (const HandleData &record) override
 
void addXRecordData (uint04 value, DXFValueManager *value_manager) override
 
void addDXFMaterial (DXFMaterial &mat) override
 
Model getLayer (const String &layer_name)
 
Material generateNewMaterial ()
 
Material getMaterial (const uint04 &material_handle)
 
virtual void addLinetype (const LineTypeData &) override
 
virtual void addLinetypeDash (double) override
 
Model getBlockModel (const String &block_name)
 
void copyBlock (Model &model, Model &block)
 
virtual void addGroup (const DXFGroup &group_info) override
 
virtual void addBlock (const BlockData &block_info) override
 
virtual void endBlock (const uint04 &) override
 
void setupColorForGeoVertices ()
 
virtual void addTextStyle (const StyleData &text_style) override
 
virtual void addPoint (const PointData &point) override
 
void addLine (const LineData &line) override
 
void addXLine (const LineData &line) override
 
void addRay (const LineData &ray) override
 
virtual void addTrace (const TraceData &data) override
 
virtual void add3dFace (const TraceData &data) override
 
void addArc (const ArcData &arc) override
 
void addCircle (const CircleData &c) override
 
virtual void addEllipse (const EllipseData &e) override
 
virtual void addPolyline (const PolylineData &poly) override
 
virtual void addMesh (CADMeshData &mesh_data) override
 
virtual void addVertex (const Vector< 4, fltp08 > &vertex) override
 
virtual void addIndex (const Vector< 4, sint04 > &vertex) override
 
virtual void addInsert (const BlockInsert &data) override
 
virtual void addSpline (const SplineData &) override
 
void addDimRadial (const RadialDimension &) override
 
void addDimDiametric (const DiametricDimension &) override
 
void addDimAngular (const AngularDimensionData< 3 > &) override
 
void addDimAngular (const AngularDimensionData< 4 > &) override
 
void addDimOrdinate (const DimOrdinateData &) override
 
virtual void addLeader (const LeaderData &data) override
 
virtual void addComment (const String &comment) override
 
virtual void endEntity () override
 
void setAttributes (const DXFAttributes &) override
 
void setExtrusion (fltp08 dx, fltp08 dy, fltp08 dz, fltp08 elevation) override
 
ExtrusiongetExtrusion ()
 
Scene paperRoot ()
 
Buffer< ModelmodelRoots () const
 
Scene currentRoot ()
 
Model currentBlock ()
 
Buffer< TextBlockparseString (const String &text, fltp08 default_height)
 
void addBulge (Geometry &geo, fltp08 bulge, const Vertex< 3, fltp08 > &p1, const Vertex< 3, fltp08 > &p2)
 
Geometry createGeometry ()
 
Model currentEntity ()
 
void setVariableInt (const String &label, int value, int key_label) override
 
Geometry currentLinework ()
 
GeometrycurrentTriMesh ()
 
GeometrycurrentPolyMesh ()
 
Geometry currentCloud ()
 
const Buffer< UUID > & pointsRead () const
 
const Buffer< UUID > & lineworkRead () const
 
const Buffer< UUID > & meshesRead () const
 
void setGroupImport (bool group_import)
 
void setTextFacingCamera (bool text_face_camera)
 
void setAutoNameObjects (bool auto_name_objects)
 
void setIgnoreKnownBlocks (bool ignore_known_blocks)
 
Buffer< UUIDgetAllReadEntities () const
 
- Public Member Functions inherited from CADEntityStreamer
 CADEntityStreamer (ProgressInfo *logger)
 
virtual ~CADEntityStreamer ()=default
 
virtual void processCodeValuePair (unsigned int, const String &)
 
virtual void addAttribute (const Attrib &)
 
virtual void addAttributeDefintion (const Attrib &)
 
virtual void setVertex (uint04, const Vector< 4, fltp08 > &)
 
virtual void addControlPoint (const Vector< 4, fltp08 > &)
 
virtual void addFitPoint (const Vector< 3, fltp08 > &)
 
virtual void addKnot (fltp08)
 
virtual void addText (const TextData &)
 
virtual void addDimAlign (const DimAlignedData &)
 
virtual void addDimLinear (const LinearDimension &)
 
virtual void addLeaderVertex (const Vector< 2, fltp08 > &)
 
virtual void addHatch (const HatchData &)
 
virtual void add3dFace (const Triangle< 3, fltp08 > &)
 
virtual void addImage (const CADImageData &)
 
virtual void linkImage (const ImageDefData &)
 
virtual void addHatchLoop (const HatchLoopData &)
 
virtual void addHatchEdge (const HatchEdgeData &)
 
virtual void addDictionaryEntry (const String &, const String &)
 
virtual void setVariableVector (const String &, Vector< 3, fltp08 >, int)
 
virtual void setVariableString (const String &, const String &, int)
 
virtual void setVariableDouble (const String &, double, int)
 
virtual void endSequence ()
 
ExtrusiongetExtrusion ()
 

Static Public Member Functions

static Matrix< fltp08GetOrientation (const Vector< 3, fltp08 > &extrusion)
 

Protected Types

enum  DXFMode {
  e_none , e_points , e_polyline , e_leader ,
  e_line , e_closed_polyline , e_polyface , e_3D_face ,
  e_3D_trace , e_measurement
}
 

Protected Member Functions

void setupLayer (Model &model)
 

Protected Attributes

Dictionary< uint04, Materialm_materials
 
Dictionary< String, Stringm_x_data
 
Dictionary< String, UUIDm_point_name_data
 
String m_last_x_data_label
 
Dictionary< uint04, UUIDm_mesh_object_dictionary_listeners
 
Dictionary< uint04, std::pair< UUID, VertexProperty > > m_mesh_object_field_listeners
 
Dictionary< uint04, std::pair< UUID, VertexProperty > > m_mesh_object_color_listeners
 
String m_current_block_name
 
ConstPointer< Unitm_unit
 
EntityData m_current_data
 
Buffer< Vertex< 3, fltp08 > > m_quad_position_data
 
Buffer< Vertex< 3, fltp08 > > m_tri_position_data
 
Buffer< RGBColorm_quad_color_data
 
Buffer< RGBColorm_tri_color_data
 
Dictionary< String, UUIDm_layers
 
Buffer< UUIDm_model_roots
 
UUID m_core_root
 
UUID m_current_paper_root
 
UUID m_blocks_root
 
UUID m_current_block
 
UUID m_current_entity
 
UUID m_last_insert
 
Geometry m_current_geometry
 
Geometry m_current_linework
 
Geometry m_current_mesh
 
Geometry m_current_points
 
UUID m_current_material
 
Buffer< UUIDm_linework_read
 
Buffer< UUIDm_points_read
 
Buffer< UUIDm_meshes_read
 
Buffer< UUIDm_blocks_read
 
Buffer< UUIDm_materials_read
 
fltp08 m_next_bulge
 
DynamicPointer< CADHandleManagerm_handle_manager
 
Dictionary< String, StyleDatam_text_styles
 
Dictionary< String, UUIDm_blocks
 
Dictionary< String, Buffer< Model > > m_blocks_to_insert
 
Dictionary< UUID, Stringm_child_blocks_to_insert
 
DesignObjectLookupm_model_lookup
 
DXFMode m_current_mode
 
bool m_read_paper_space = false
 
bool m_color_by_vertex = false
 
bool m_group_import = true
 
bool m_text_face_camera = false
 
bool m_auto_name_objects = true
 
bool m_ignore_known_blocks = true
 
bool m_ignore_known_materials = true
 
bool m_ignore_current = false
 
Vertex< 3, fltp08m_position_offset = Constant<Vertex<3, fltp08>>::NaN
 
std::function< void(uint04 value, DXFValueManager *manager)> m_xdata_callback
 
uint04 m_circle_count = 0
 
uint04 m_ellipse_count = 0
 
uint04 m_insert_count = 0
 
uint04 m_attribute_count = 0
 
CADMeshVertexAttributeSetterm_mesh_attribute_setter = nullptr
 
CADMeshVertexColorSetterm_mesh_color_setter = nullptr
 
File m_relative_path
 
DimensionOptions m_dim_options
 
- Protected Attributes inherited from CADEntityStreamer
bool m_log_features
 
Extrusion m_extrusion
 
ProgressInfom_logger
 

Member Enumeration Documentation

◆ DXFMode

enum DXFMode
protected
Enumerator
e_none 
e_points 
e_polyline 
e_leader 
e_line 
e_closed_polyline 
e_polyface 
e_3D_face 
e_3D_trace 
e_measurement 

Constructor & Destructor Documentation

◆ EntityConverter()

EntityConverter ( const File & relative_path,
DesignObjectLookup * lookup,
ProgressInfo * logger )
inline

◆ ~EntityConverter()

virtual ~EntityConverter ( )
inlinevirtual

Member Function Documentation

◆ _addLayer()

void _addLayer ( const LayerData & layer_data)
inline

layer_data.flags[LayerData::e_frozen] &&

◆ add3dFace()

virtual void add3dFace ( const TraceData & data)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addArc()

void addArc ( const ArcData & arc)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addBlock()

virtual void addBlock ( const BlockData & block_info)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addBulge()

void addBulge ( Geometry & geo,
fltp08 bulge,
const Vertex< 3, fltp08 > & p1,
const Vertex< 3, fltp08 > & p2 )
inline

◆ addCircle()

void addCircle ( const CircleData & c)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addComment()

virtual void addComment ( const String & comment)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addDictionary()

void addDictionary ( const CADDictionaryObject & dictionary)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addDimAngular() [1/2]

void addDimAngular ( const AngularDimensionData< 3 > & )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addDimAngular() [2/2]

void addDimAngular ( const AngularDimensionData< 4 > & )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addDimDiametric()

void addDimDiametric ( const DiametricDimension & )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addDimOrdinate()

void addDimOrdinate ( const DimOrdinateData & )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addDimRadial()

void addDimRadial ( const RadialDimension & )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addDXFMaterial()

void addDXFMaterial ( DXFMaterial & mat)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addEllipse()

virtual void addEllipse ( const EllipseData & e)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addGroup()

virtual void addGroup ( const DXFGroup & group_info)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addIndex()

virtual void addIndex ( const Vector< 4, sint04 > & vertex)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addInsert()

virtual void addInsert ( const BlockInsert & data)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addLayer()

void addLayer ( const LayerData & layer)
inlinefinaloverridevirtual

Reimplemented from CADEntityStreamer.

◆ addLeader()

virtual void addLeader ( const LeaderData & data)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addLine()

void addLine ( const LineData & line)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addLinetype()

virtual void addLinetype ( const LineTypeData & )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addLinetypeDash()

virtual void addLinetypeDash ( double )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addMesh()

virtual void addMesh ( CADMeshData & mesh_data)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addPoint()

virtual void addPoint ( const PointData & point)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addPolyline()

virtual void addPolyline ( const PolylineData & poly)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addRay()

void addRay ( const LineData & ray)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addSpline()

virtual void addSpline ( const SplineData & )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addTextStyle()

virtual void addTextStyle ( const StyleData & text_style)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addTrace()

virtual void addTrace ( const TraceData & data)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addVertex()

virtual void addVertex ( const Vector< 4, fltp08 > & vertex)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addXLine()

void addXLine ( const LineData & line)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addXRecord()

void addXRecord ( const HandleData & record)
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ addXRecordData()

void addXRecordData ( uint04 value,
DXFValueManager * value_manager )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ convertFromCADName()

String convertFromCADName ( const String & file_name,
const TranslatedString & object_type,
uint04 object_count )
inline

◆ copyBlock()

void copyBlock ( Model & model,
Model & block )
inline

◆ createGeometry()

Geometry createGeometry ( )
inline

◆ currentBlock()

Model currentBlock ( )
inline

◆ currentCloud()

Geometry currentCloud ( )
inline

◆ currentEntity()

Model currentEntity ( )
inline

◆ currentLinework()

Geometry currentLinework ( )
inline

◆ currentPolyMesh()

Geometry & currentPolyMesh ( )
inline

◆ currentRoot()

Scene currentRoot ( )
inline

◆ currentTriMesh()

Geometry & currentTriMesh ( )
inline

◆ endBlock()

virtual void endBlock ( const uint04 & )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ endEntity()

virtual void endEntity ( )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ endFaceSection()

void endFaceSection ( )
inline

◆ endSection()

void endSection ( )
inlinefinaloverridevirtual

Reimplemented from CADEntityStreamer.

◆ generateNewMaterial()

Material generateNewMaterial ( )
inline

◆ getAllReadEntities()

Buffer< UUID > getAllReadEntities ( ) const
inlinenodiscard

◆ getBlockModel()

Model getBlockModel ( const String & block_name)
inline

◆ getExtrusion()

Extrusion & getExtrusion ( )
inline

◆ getLayer()

Model getLayer ( const String & layer_name)
inline

◆ getMaterial() [1/2]

Material getMaterial ( )
inline

◆ getMaterial() [2/2]

Material getMaterial ( const uint04 & material_handle)
inline

◆ GetOrientation()

static Matrix< fltp08 > GetOrientation ( const Vector< 3, fltp08 > & extrusion)
inlinestatic

◆ lineworkRead()

const Buffer< UUID > & lineworkRead ( ) const
inline

◆ meshesRead()

const Buffer< UUID > & meshesRead ( ) const
inline

◆ modelRoots()

Buffer< Model > modelRoots ( ) const
inline

◆ paperRoot()

Scene paperRoot ( )
inline

◆ parseString()

Buffer< TextBlock > parseString ( const String & text,
fltp08 default_height )
inline

◆ pointsRead()

const Buffer< UUID > & pointsRead ( ) const
inline

◆ setAttributes()

void setAttributes ( const DXFAttributes & )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ setAutoNameObjects()

void setAutoNameObjects ( bool auto_name_objects)
inline

◆ setExtrusion()

void setExtrusion ( fltp08 dx,
fltp08 dy,
fltp08 dz,
fltp08 elevation )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ setGroupImport()

void setGroupImport ( bool group_import)
inline

◆ setHandleManager()

void setHandleManager ( const DynamicPointer< CADHandleManager > & handle_manager)
inline

◆ setIgnoreKnownBlocks()

void setIgnoreKnownBlocks ( bool ignore_known_blocks)
inline

◆ setTextFacingCamera()

void setTextFacingCamera ( bool text_face_camera)
inline

◆ setupColorForGeoVertices()

void setupColorForGeoVertices ( )
inline

◆ setupEntityMaterial()

void setupEntityMaterial ( Model model)
inline

◆ setupLayer()

void setupLayer ( Model & model)
inlineprotected

◆ setVariableInt()

void setVariableInt ( const String & label,
int value,
int key_label )
inlineoverridevirtual

Reimplemented from CADEntityStreamer.

◆ unit()

const ConstPointer< Unit > & unit ( ) const
inline

Member Data Documentation

◆ m_attribute_count

uint04 m_attribute_count = 0
protected

◆ m_auto_name_objects

bool m_auto_name_objects = true
protected

◆ m_blocks

Dictionary<String, UUID> m_blocks
protected

◆ m_blocks_read

Buffer<UUID> m_blocks_read
protected

◆ m_blocks_root

UUID m_blocks_root
protected

◆ m_blocks_to_insert

Dictionary<String, Buffer<Model> > m_blocks_to_insert
protected

◆ m_child_blocks_to_insert

Dictionary<UUID, String> m_child_blocks_to_insert
protected

◆ m_circle_count

uint04 m_circle_count = 0
protected

◆ m_color_by_vertex

bool m_color_by_vertex = false
protected

◆ m_core_root

UUID m_core_root
protected

◆ m_current_block

UUID m_current_block
protected

◆ m_current_block_name

String m_current_block_name
protected

◆ m_current_data

EntityData m_current_data
protected

◆ m_current_entity

UUID m_current_entity
protected

◆ m_current_geometry

Geometry m_current_geometry
protected

◆ m_current_linework

Geometry m_current_linework
protected

◆ m_current_material

UUID m_current_material
protected

◆ m_current_mesh

Geometry m_current_mesh
protected

◆ m_current_mode

DXFMode m_current_mode
protected

◆ m_current_paper_root

UUID m_current_paper_root
protected

◆ m_current_points

Geometry m_current_points
protected

◆ m_dim_options

DimensionOptions m_dim_options
protected

◆ m_ellipse_count

uint04 m_ellipse_count = 0
protected

◆ m_group_import

bool m_group_import = true
protected

◆ m_handle_manager

DynamicPointer<CADHandleManager> m_handle_manager
protected

◆ m_ignore_current

bool m_ignore_current = false
protected

◆ m_ignore_known_blocks

bool m_ignore_known_blocks = true
protected

◆ m_ignore_known_materials

bool m_ignore_known_materials = true
protected

◆ m_insert_count

uint04 m_insert_count = 0
protected

◆ m_last_insert

UUID m_last_insert
protected

◆ m_last_x_data_label

String m_last_x_data_label
protected

◆ m_layers

Dictionary<String, UUID> m_layers
protected

◆ m_linework_read

Buffer<UUID> m_linework_read
protected

◆ m_materials

Dictionary<uint04, Material> m_materials
protected

◆ m_materials_read

Buffer<UUID> m_materials_read
protected

◆ m_mesh_attribute_setter

CADMeshVertexAttributeSetter* m_mesh_attribute_setter = nullptr
protected

◆ m_mesh_color_setter

CADMeshVertexColorSetter* m_mesh_color_setter = nullptr
protected

◆ m_mesh_object_color_listeners

Dictionary<uint04, std::pair<UUID, VertexProperty> > m_mesh_object_color_listeners
protected

◆ m_mesh_object_dictionary_listeners

Dictionary<uint04, UUID> m_mesh_object_dictionary_listeners
protected

◆ m_mesh_object_field_listeners

Dictionary<uint04, std::pair<UUID, VertexProperty> > m_mesh_object_field_listeners
protected

◆ m_meshes_read

Buffer<UUID> m_meshes_read
protected

◆ m_model_lookup

DesignObjectLookup* m_model_lookup
protected

◆ m_model_roots

Buffer<UUID> m_model_roots
protected

◆ m_next_bulge

fltp08 m_next_bulge
protected

◆ m_point_name_data

Dictionary<String, UUID> m_point_name_data
protected

◆ m_points_read

Buffer<UUID> m_points_read
protected

◆ m_position_offset

Vertex<3, fltp08> m_position_offset = Constant<Vertex<3, fltp08>>::NaN
protected

◆ m_quad_color_data

Buffer<RGBColor> m_quad_color_data
protected

◆ m_quad_position_data

Buffer<Vertex<3, fltp08> > m_quad_position_data
protected

◆ m_read_paper_space

bool m_read_paper_space = false
protected

◆ m_relative_path

File m_relative_path
protected

◆ m_text_face_camera

bool m_text_face_camera = false
protected

◆ m_text_styles

Dictionary<String, StyleData> m_text_styles
protected

◆ m_tri_color_data

Buffer<RGBColor> m_tri_color_data
protected

◆ m_tri_position_data

Buffer<Vertex<3, fltp08> > m_tri_position_data
protected

◆ m_unit

ConstPointer<Unit> m_unit
protected

◆ m_x_data

Dictionary<String, String> m_x_data
protected

◆ m_xdata_callback

std::function<void(uint04 value, DXFValueManager* manager)> m_xdata_callback
protected

The documentation for this class was generated from the following file: