API Documentation
Loading...
Searching...
No Matches
CADEntityStreamer.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: CAD
28File: CADEntityStreamer
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "CADEntities.h"
34#include "DXFAttributes.h"
35#include "Base/Headers/Log.h"
37
38namespace NDEVR
39{
40 class DXFValueManager;
42 {
43 public:
45 : m_log_features(false)
46 , m_logger(*logger)
47 {}
48 virtual ~CADEntityStreamer() = default;
49 virtual void processCodeValuePair(unsigned int, const String&) {/*if(m_log_features) m_logger.addMessage("Code Value Pair");*/ }
50 virtual void endSection() { if (m_log_features)m_logger.addMessage(_t("End Section")); }
51 virtual void addLayer(const LayerData&) { if (m_log_features)m_logger.addMessage(_t("Add Layer")); }
52 virtual void addLinetype(const LineTypeData&) { if (m_log_features)m_logger.addMessage(_t("Add Line Type")); }
53 virtual void addLinetypeDash(double) { if (m_log_features)m_logger.addMessage(_t("Add Line Type Dash")); }
54 virtual void addBlock(const BlockData&) { if (m_log_features)m_logger.addMessage(_t("Add Block")); }
55 virtual void addGroup(const DXFGroup&) { if (m_log_features)m_logger.addMessage(_t("Add Group")); }
56 virtual void endBlock(const uint04&) { if (m_log_features) m_logger.addMessage(_t("End Block")); }
57 virtual void addTextStyle(const StyleData&) { if (m_log_features)m_logger.addMessage(_t("Add Text Style")); }
58 virtual void addPoint(const PointData&) { if (m_log_features)m_logger.addMessage(_t("Add Point")); }
59 virtual void addLine(const LineData&) { if (m_log_features)m_logger.addMessage(_t("Add Line")); }
60 virtual void addXLine(const LineData&) { if (m_log_features)m_logger.addMessage(_t("Add X Line")); }
61 virtual void addDXFMaterial(DXFMaterial&) { if (m_log_features)m_logger.addMessage(_t("Add Material")); }
62 virtual void addRay(const LineData&) { if (m_log_features)m_logger.addMessage(_t("Add Ray")); }
63 virtual void addAttribute(const Attrib&) { if (m_log_features)m_logger.addMessage(_t("Add Attribute")); }
64 virtual void addAttributeDefintion(const Attrib&) { if (m_log_features)m_logger.addMessage(_t("Add Attribute Defintion")); }
65
66 virtual void addArc(const ArcData&) { if (m_log_features)m_logger.addMessage(_t("Add Arc")); }
67 virtual void addCircle(const CircleData&) { if (m_log_features)m_logger.addMessage(_t("Add Circle")); }
68 virtual void addEllipse(const EllipseData&) { if (m_log_features)m_logger.addMessage(_t("Add Ellipse")); }
69
70 virtual void addPolyline(const PolylineData&) { if (m_log_features)m_logger.addMessage(_t("Add Polyline")); }
71 virtual void addVertex(const Vector<4, fltp08>&) { if (m_log_features)m_logger.addMessage(_t("Add Vertex")); }
72 virtual void setVertex(uint04, const Vector<4, fltp08>&) { if (m_log_features)m_logger.addMessage(_t("Set Vertex")); }
73 virtual void addIndex(const Vector<4, sint04>&) { if (m_log_features)m_logger.addMessage(_t("Add Index")); }
74
75 virtual void addSpline(const SplineData&) { if (m_log_features)m_logger.addMessage(_t("Add Spline")); }
76 virtual void addControlPoint(const Vector<4, fltp08>&) { if (m_log_features)m_logger.addMessage(_t("Add Control Point")); }
77 virtual void addFitPoint(const Vector<3, fltp08>&) { if (m_log_features)m_logger.addMessage(_t("Add Fit Point")); }
78 virtual void addKnot(fltp08) { if (m_log_features)m_logger.addMessage(_t("Add Knot")); }
79 virtual void addInsert(const BlockInsert&) { m_logger.addMessage(_t("Add Insert")); }
80
81 virtual void addText(const TextData&) { if (m_log_features) m_logger.addMessage(_t("Add Text")); }
82 virtual void addDimAlign(const DimAlignedData&) { if (m_log_features) m_logger.addMessage(_t("Add Dim Align")); }
83 virtual void addDimLinear(const LinearDimension&) { if (m_log_features) m_logger.addMessage(_t("Add Dim Linear")); }
84 virtual void addDimRadial(const RadialDimension&) { if (m_log_features) m_logger.addMessage(_t("Add Dim Radial")); }
85 virtual void addDimDiametric(const DiametricDimension&) { if (m_log_features) m_logger.addMessage(_t("Add Dim Diametric")); }
86 virtual void addDimAngular(const AngularDimensionData<3>&) { if (m_log_features) m_logger.addMessage(_t("Add Dim Angular")); }
87 virtual void addDimAngular(const AngularDimensionData<4>&) { if (m_log_features) m_logger.addMessage(_t("Add Dim Angular 3P")); }
88 virtual void addDimOrdinate(const DimOrdinateData&) { if (m_log_features) m_logger.addMessage(_t("Add Dim Ordinate")); }
89 virtual void addMesh(CADMeshData&) { if (m_log_features) m_logger.addMessage(_t("Add MESH")); }
90 virtual void addLeader(const LeaderData&) { if (m_log_features) m_logger.addMessage(_t("Add Leader")); }
91 virtual void addLeaderVertex(const Vector<2, fltp08>&) { if (m_log_features) m_logger.addMessage(_t("Add Leader Vertex")); }
92
93 virtual void addHatch(const HatchData&) { if (m_log_features) m_logger.addMessage(_t("Add Hatch")); }
94
95 virtual void addTrace(const TraceData&) { if (m_log_features) m_logger.addMessage(_t("Add Trace")); }
96 virtual void add3dFace(const TraceData&) { if (m_log_features) m_logger.addMessage(_t("Add 3D Face")); }
97 virtual void add3dFace(const Triangle<3, fltp08>&) { if (m_log_features) m_logger.addMessage(_t("Add 3D Face")); }
98
99 virtual void addImage(const CADImageData&) { if (m_log_features) m_logger.addMessage(_t("Add Image")); }
100 virtual void linkImage(const ImageDefData&) { if (m_log_features) m_logger.addMessage(_t("Link Image")); }
101 virtual void addHatchLoop(const HatchLoopData&) { if (m_log_features) m_logger.addMessage(_t("Add Hatch Loop")); }
102 virtual void addHatchEdge(const HatchEdgeData&) { if (m_log_features) m_logger.addMessage(_t("Add Hatch Edge")); }
103
104 virtual void addXRecord(const HandleData&) { if (m_log_features) m_logger.addMessage(_t("Add XRecord")); }
105 virtual void addXRecordData(uint04, DXFValueManager*) { if (m_log_features) m_logger.addMessage(_t("Add X Data")); };
106
107 virtual void addDictionary(const CADDictionaryObject&) { if (m_log_features) m_logger.addMessage(_t("Add Dictionary")); }
108 virtual void addDictionaryEntry(const String&, const String&) { if (m_log_features) m_logger.addMessage(_t("Add Dictionary")); }
109
110 virtual void endEntity() { if (m_log_features) m_logger.addMessage(_t("End Sequence")); }
111
112 virtual void addComment(const String&) { if (m_log_features) m_logger.addMessage(_t("End Sequence")); }
113
114 virtual void setVariableVector(const String&, Vector<3, fltp08>, int) { if (m_log_features) m_logger.addMessage(_t("End Sequence")); }
115 virtual void setVariableString(const String&, const String&, int) { if (m_log_features) m_logger.addMessage(_t("End Sequence")); }
116 virtual void setVariableInt(const String&, int, int) { if (m_log_features) m_logger.addMessage(_t("End Sequence")); }
117 virtual void setVariableDouble(const String&, double, int) { if (m_log_features) m_logger.addMessage(_t("End Sequence")); }
118 virtual void endSequence() { if (m_log_features) m_logger.addMessage(_t("End Sequence")); }
119
120 virtual void setAttributes(const DXFAttributes&) {
121 //m_attributes = attrib;
122 }
123
124
125
126 virtual void setExtrusion(fltp08 dx, fltp08 dy, fltp08 dz, fltp08 elevation) {
127 m_extrusion.setDirection(dx, dy, dz);
128 m_extrusion.setElevation(elevation);
129 }
130
132 return m_extrusion;
133 }
134
135 protected:
139 };
140}
141
#define _t(english_string)
Definition Translator.h:87
Definition CADEntityStreamer.h:42
virtual void addDimAngular(const AngularDimensionData< 4 > &)
Definition CADEntityStreamer.h:87
virtual void setVariableVector(const String &, Vector< 3, fltp08 >, int)
Definition CADEntityStreamer.h:114
virtual void addHatchLoop(const HatchLoopData &)
Definition CADEntityStreamer.h:101
virtual void addDictionaryEntry(const String &, const String &)
Definition CADEntityStreamer.h:108
virtual void addDXFMaterial(DXFMaterial &)
Definition CADEntityStreamer.h:61
virtual void endSection()
Definition CADEntityStreamer.h:50
virtual void addDimOrdinate(const DimOrdinateData &)
Definition CADEntityStreamer.h:88
virtual void addLinetypeDash(double)
Definition CADEntityStreamer.h:53
virtual void addKnot(fltp08)
Definition CADEntityStreamer.h:78
virtual void add3dFace(const TraceData &)
Definition CADEntityStreamer.h:96
CADEntityStreamer(ProgressInfo *logger)
Definition CADEntityStreamer.h:44
virtual void linkImage(const ImageDefData &)
Definition CADEntityStreamer.h:100
virtual void addBlock(const BlockData &)
Definition CADEntityStreamer.h:54
virtual void addGroup(const DXFGroup &)
Definition CADEntityStreamer.h:55
virtual void addHatchEdge(const HatchEdgeData &)
Definition CADEntityStreamer.h:102
virtual void addVertex(const Vector< 4, fltp08 > &)
Definition CADEntityStreamer.h:71
virtual void setVariableDouble(const String &, double, int)
Definition CADEntityStreamer.h:117
virtual void addLayer(const LayerData &)
Definition CADEntityStreamer.h:51
virtual void addDimRadial(const RadialDimension &)
Definition CADEntityStreamer.h:84
virtual void addDimAlign(const DimAlignedData &)
Definition CADEntityStreamer.h:82
virtual void addLine(const LineData &)
Definition CADEntityStreamer.h:59
Extrusion m_extrusion
Definition CADEntityStreamer.h:137
virtual void addDimAngular(const AngularDimensionData< 3 > &)
Definition CADEntityStreamer.h:86
virtual void endBlock(const uint04 &)
Definition CADEntityStreamer.h:56
virtual void addDictionary(const CADDictionaryObject &)
Definition CADEntityStreamer.h:107
virtual void addFitPoint(const Vector< 3, fltp08 > &)
Definition CADEntityStreamer.h:77
virtual void addLeader(const LeaderData &)
Definition CADEntityStreamer.h:90
virtual void setExtrusion(fltp08 dx, fltp08 dy, fltp08 dz, fltp08 elevation)
Definition CADEntityStreamer.h:126
virtual void addPolyline(const PolylineData &)
Definition CADEntityStreamer.h:70
virtual void addTextStyle(const StyleData &)
Definition CADEntityStreamer.h:57
virtual void addXLine(const LineData &)
Definition CADEntityStreamer.h:60
virtual ~CADEntityStreamer()=default
virtual void addComment(const String &)
Definition CADEntityStreamer.h:112
virtual void setVariableString(const String &, const String &, int)
Definition CADEntityStreamer.h:115
ProgressInfo & m_logger
Definition CADEntityStreamer.h:138
virtual void addXRecordData(uint04, DXFValueManager *)
Definition CADEntityStreamer.h:105
virtual void addMesh(CADMeshData &)
Definition CADEntityStreamer.h:89
virtual void endEntity()
Definition CADEntityStreamer.h:110
Extrusion & getExtrusion()
Definition CADEntityStreamer.h:131
virtual void addHatch(const HatchData &)
Definition CADEntityStreamer.h:93
virtual void addLeaderVertex(const Vector< 2, fltp08 > &)
Definition CADEntityStreamer.h:91
virtual void addControlPoint(const Vector< 4, fltp08 > &)
Definition CADEntityStreamer.h:76
bool m_log_features
Definition CADEntityStreamer.h:136
virtual void addDimLinear(const LinearDimension &)
Definition CADEntityStreamer.h:83
virtual void addAttribute(const Attrib &)
Definition CADEntityStreamer.h:63
virtual void addText(const TextData &)
Definition CADEntityStreamer.h:81
virtual void addXRecord(const HandleData &)
Definition CADEntityStreamer.h:104
virtual void addSpline(const SplineData &)
Definition CADEntityStreamer.h:75
virtual void addAttributeDefintion(const Attrib &)
Definition CADEntityStreamer.h:64
virtual void add3dFace(const Triangle< 3, fltp08 > &)
Definition CADEntityStreamer.h:97
virtual void setVertex(uint04, const Vector< 4, fltp08 > &)
Definition CADEntityStreamer.h:72
virtual void addLinetype(const LineTypeData &)
Definition CADEntityStreamer.h:52
virtual void addInsert(const BlockInsert &)
Definition CADEntityStreamer.h:79
virtual void endSequence()
Definition CADEntityStreamer.h:118
virtual void processCodeValuePair(unsigned int, const String &)
Definition CADEntityStreamer.h:49
virtual void addTrace(const TraceData &)
Definition CADEntityStreamer.h:95
virtual void addCircle(const CircleData &)
Definition CADEntityStreamer.h:67
virtual void addIndex(const Vector< 4, sint04 > &)
Definition CADEntityStreamer.h:73
virtual void addImage(const CADImageData &)
Definition CADEntityStreamer.h:99
virtual void setVariableInt(const String &, int, int)
Definition CADEntityStreamer.h:116
virtual void setAttributes(const DXFAttributes &)
Definition CADEntityStreamer.h:120
virtual void addArc(const ArcData &)
Definition CADEntityStreamer.h:66
virtual void addRay(const LineData &)
Definition CADEntityStreamer.h:62
virtual void addPoint(const PointData &)
Definition CADEntityStreamer.h:58
virtual void addEllipse(const EllipseData &)
Definition CADEntityStreamer.h:68
virtual void addDimDiametric(const DiametricDimension &)
Definition CADEntityStreamer.h:85
Definition DXFAttributes.h:39
Definition DXFValueManager.h:42
logic for storing a extrusion data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:1004
void setDirection(fltp08 dx, fltp08 dy, fltp08 dz)
Definition CADEntities.h:1016
void setElevation(double elevation)
Definition CADEntities.h:1024
Definition ProgressInfo.hpp:43
virtual bool addMessage(const LogMessage &message)=0
Definition String.h:40
Definition Triangle.hpp:143
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181
logic for storing an angular dimension in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:621
logic for storing a arc data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:271
logic for storing a attribue data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:458
Definition CADEntities.h:172
Definition CADEntities.h:502
Definition CADEntities.h:572
logic for storing a image data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:933
Definition CADEntities.h:366
logic for storing a circle data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:477
Definition CADEntities.h:982
Definition CADEntities.h:970
logic for storing an diametric dimension in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:605
Definition CADEntities.h:553
Definition CADEntities.h:642
Definition CADEntities.h:482
Definition CADEntities.h:133
logic for storing a hatch-data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:701
Definition CADEntities.h:737
Definition CADEntities.h:726
Definition CADEntities.h:990
Definition CADEntities.h:154
logic for storing a leader in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:660
Definition CADEntities.h:491
Definition CADEntities.h:188
Definition CADEntities.h:562
Definition CADEntities.h:509
logic for storing a polyline data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:293
logic for storing a radial dimension in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:590
logic for storing a spline data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:352
logic for storing a style data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:217
logic for storing a text data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:437
logic for storing a trace data in a CAD-friendly way for exporting and importing.
Definition CADEntities.h:337