CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
DbViewRepInitParams.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24#ifndef _OdDbViewInitParams_H
25#define _OdDbViewInitParams_H
26
27#include "DbViewRep.h"
29#include "DbSectionSymbol.h"
30#include "DbDetailSymbol.h"
31
32#include "TD_PackPush.h"
33
40public:
42 : m_scale(1.)
43 , m_viewType(OdDbViewRep::kBase)
44 , m_orientation(OdDbViewRep::kFront), m_viewStyleType(OdDbViewRep::kVisibleAndHiddenLines)
45 , m_boundaryType(OdDbDetailSymbol::kCircularBoundary), m_modelEdge(OdDbDetailViewStyle::kSmoothWithConnectionLine)
46 , m_constrainTo(OdDbViewRepSectionDefinition::kConstrainUndefined)
47 , m_overrides(kEmpty)
48 , m_bInheritScale(true), m_bInheritStyle(true), m_bInheritSection(false), m_bShowLabel(true), m_bMethodAligned(true), m_bShaded(false)
49 , m_bShowInterferenceEdges(false), m_bShowTangentEdges(false), m_bTangentEdgesForeshortened(false)
50 {
51 }
52
54 {
55 if (!labelIdentifier().isEmpty())
57 }
58
60 {
61 applyToViewSymbol(symbol);
62 //symbol.setModelEdgeOrigin();
63 if (GETBIT(m_overrides, kDetailViewModelEdgeType))
65 if (GETBIT(m_overrides, kBoundaryType))
67 if (GETBIT(m_overrides, kScale))
68 symbol.setDetailViewScale(scale());
70 }
71
73 {
74 applyToViewSymbol(symbol);
75 }
76
77 OdDbViewRep::ViewOrientType viewOrientType() const {return m_orientation;}
79
80 const OdGePoint3d& center() const {return m_centerPoint;}
81 void setCenter(const OdGePoint3d& pt) {m_centerPoint = pt;}
82
83 double scale() const {return m_scale;}
84 void setScale(double scale){SETBIT_1((OdUInt32&)m_overrides,kScale); m_bInheritScale = false; m_scale = scale;}
85
86 OdDbObjectId scaleId() const{return m_idScale;} // TODO: Use somehow
87 void setScaleId(const OdDbObjectId& scaleId){SETBIT_1((OdUInt32&)m_overrides,kScale); m_bInheritScale = false; m_idScale = scaleId;}
88
89 void setScale(const OdDbObjectId& scaleId, double scale){SETBIT_1((OdUInt32&)m_overrides,kScale); m_bInheritScale = false; m_scale = scale; m_idScale = scaleId;}
90
91 bool inheritScale() const{return m_bInheritScale;}
92 void setInheritScale(bool inherit){m_bInheritScale = inherit;}
93
94 bool inheritStyle() const{return m_bInheritStyle;}
95 void setInheritStyle(bool inherit){m_bInheritStyle = inherit;}
96
97 bool inheritSection() const { return m_bInheritSection; }
98 void setInheritSection(bool inherit) { m_bInheritSection = inherit; }
99
100 bool showInterferenceEdges() const{return m_bShowInterferenceEdges;}
101 void setShowInterferenceEdges(bool visibility){m_bShowInterferenceEdges = visibility;}
102
103 bool showTangentEdges() const{return m_bShowTangentEdges;}
104 void setShowTangentEdges(bool visibility){m_bShowTangentEdges = visibility;}
105
106 bool tangentEdgesForeshortened() const { return m_bTangentEdgesForeshortened; }
107 void setTangentEdgesForeshortened(bool foreshortened) { m_bTangentEdgesForeshortened = foreshortened; }
108
109 bool labelVisibility() const{return m_bShowLabel;}
110 void setLabelVisibility(bool visibility){m_bShowLabel = visibility;}
111
112 bool sectionMethodAligned() const { return m_bMethodAligned; }
113 void setSectionMethodAligned(bool bMethodAligned) { m_bMethodAligned = bMethodAligned; }
114
115 const OdGePoint3d& target() const{return m_target;}
116 void setTarget(const OdGePoint3d& target){m_target = target;}
117
118 const OdGePoint3d& eye() const { return m_eye; }
119 void setEye(const OdGePoint3d& eye) { m_eye = eye; }
120
121 const OdGeVector3d& upVec() const { return m_up; }
122 void setUpVec(const OdGeVector3d& up) { m_up = up; }
123
124 OdDbViewRep::ViewType viewType() const{return m_viewType;}
126
127 OdDbViewRep::ViewStyleType viewStyleType() const{return m_viewStyleType;}
129
130 bool isShaded() const {return m_bShaded;}
131 void setIsShaded(bool value) {m_bShaded = value;}
132
133 OdString labelIdentifier() const{return m_identifier;}
134 void setLabelIdentifier(const OdString& identifier){m_identifier = identifier;}
135
136 const OdDbObjectIdArray& selSetEntities() const {return m_aSelectedIds;} // TODO: Change to selSetId
137 void setSelSetEntities(const OdDbObjectIdArray& selectedIds){m_aSelectedIds = selectedIds;} // TODO: Change to selSetId
138
139 OdDbObjectId parentViewRepId() const{return m_idParent;}
140 void setParentViewRepId(OdDbObjectId idParent){m_idParent = idParent;}
141
142 OdDbDetailSymbol::BoundaryType boundaryType() const {return m_boundaryType;}
143 void setBoundaryType(OdDbDetailSymbol::BoundaryType type) {SETBIT_1((OdUInt32&)m_overrides,kBoundaryType); m_boundaryType = type;}
144
146 void setDetailViewModelEdgeType(OdDbDetailViewStyle::ModelEdge type) {SETBIT_1((OdUInt32&)m_overrides,kDetailViewModelEdgeType); m_modelEdge = type;}
147
150 void setConstrainTo(OdDbViewRepSectionDefinition::ESectionConstrainTo constrain) { m_constrainTo = constrain; }
153
154private:
155 OdDbObjectId m_idParent;
156 OdDbObjectIdArray m_aSelectedIds; // TODO: Change to selSetId
157
158 OdGePoint3d m_centerPoint;
159 OdGePoint3d m_target;
160 OdGePoint3d m_eye;
161 OdGeVector3d m_up;
162
163 OdString m_identifier;
164
165 double m_scale;
166 OdDbObjectId m_idScale; // TODO: Use somehow
167
168 OdDbViewRep::ViewType m_viewType;
169 OdDbViewRep::ViewOrientType m_orientation;
170 OdDbViewRep::ViewStyleType m_viewStyleType;
171
172 OdDbDetailSymbol::BoundaryType m_boundaryType;
175
176 enum Overrides
177 {
178 kEmpty = 0,
179 kScale = 0x2,
180 kBoundaryType = 0x4,
181 kDetailViewModelEdgeType = 0x8,
182 // TODO: others
183 };
184 Overrides m_overrides;
185
186 bool m_bInheritScale;
187 bool m_bInheritStyle;
188 bool m_bInheritSection;
189 bool m_bShowLabel;
190 bool m_bMethodAligned;
191 bool m_bShaded;
192 bool m_bShowInterferenceEdges;
193 bool m_bShowTangentEdges;
194 bool m_bTangentEdgesForeshortened;
195};
196
197#include "TD_PackPop.h"
198
199#endif // _OdDbViewInitParams_H
true
false
Definition DimVarDefs.h:165
OdArray< OdDbObjectId, OdClrMemAllocator< OdDbObjectId > > OdDbObjectIdArray
Definition IdArrays.h:53
unsigned int OdUInt32
#define GETBIT(flags, bit)
Definition OdaDefs.h:517
#define SETBIT_1(flags, bit)
Definition OdaDefs.h:520
OdResult setDisplayIdentifier(const bool displayIdentifier)
OdResult setDetailViewScale(double viewScale)
OdResult setModelEdgeType(OdDbDetailViewStyle::ModelEdge modelEdgeType)
OdResult setBoundaryType(OdDbDetailSymbol::BoundaryType bndType)
bool isConstrainToLastSegment() const
void applyToDetailSymbol(OdDbDetailSymbol &symbol) const
void setShowTangentEdges(bool visibility)
OdDbViewRep::ViewOrientType viewOrientType() const
void setViewOrientType(OdDbViewRep::ViewOrientType type)
OdDbViewRep::ViewStyleType viewStyleType() const
void setIsShaded(bool value)
void applyToSectionSymbol(OdDbSectionSymbol &symbol) const
void setDetailViewModelEdgeType(OdDbDetailViewStyle::ModelEdge type)
OdDbViewRepSectionDefinition::ESectionConstrainTo constrainTo() const
void applyToViewSymbol(OdDbViewSymbol &symbol) const
void setScale(const OdDbObjectId &scaleId, double scale)
bool showInterferenceEdges() const
void setInheritScale(bool inherit)
void setLabelVisibility(bool visibility)
OdDbDetailSymbol::BoundaryType boundaryType() const
const OdGePoint3d & target() const
void setViewType(OdDbViewRep::ViewType type)
void setEye(const OdGePoint3d &eye)
void setLabelIdentifier(const OdString &identifier)
void setViewStyleType(OdDbViewRep::ViewStyleType type)
void setConstrainTo(OdDbViewRepSectionDefinition::ESectionConstrainTo constrain)
void setUpVec(const OdGeVector3d &up)
void setSelSetEntities(const OdDbObjectIdArray &selectedIds)
void setInheritSection(bool inherit)
void setShowInterferenceEdges(bool visibility)
void setCenter(const OdGePoint3d &pt)
OdDbViewRep::ViewType viewType() const
void setTarget(const OdGePoint3d &target)
void setTangentEdgesForeshortened(bool foreshortened)
OdDbObjectId parentViewRepId() const
void setSectionMethodAligned(bool bMethodAligned)
void setScale(double scale)
const OdDbObjectIdArray & selSetEntities() const
const OdGePoint3d & eye() const
OdString labelIdentifier() const
const OdGePoint3d & center() const
void setInheritStyle(bool inherit)
void setScaleId(const OdDbObjectId &scaleId)
bool sectionMethodAligned() const
void setBoundaryType(OdDbDetailSymbol::BoundaryType type)
OdDbObjectId scaleId() const
bool tangentEdgesForeshortened() const
OdDbDetailViewStyle::ModelEdge detailViewModelEdgeType() const
void setParentViewRepId(OdDbObjectId idParent)
const OdGeVector3d & upVec() const
OdResult setIdentifier(const OdString &sName)
GLuint GLsizei GLsizei GLint GLenum * type
Definition gles2_ext.h:274
GLsizei const GLfloat * value
Definition gles2_ext.h:302