38 inline virtual bool isVisible()
const {
return m_visible; }
40 inline virtual void setVisible(
bool state) { m_visible = state; }
46 inline virtual bool isRedraw()
const {
return m_modelRedraw; }
48 inline virtual void setRedraw(
bool state) { m_modelRedraw = state; }
52 inline virtual void setFixedId(
bool state) { m_fixedId = state; }
53 inline virtual bool isFixedId() {
return m_fixedId; }
57 return m_lockedVisibility;
64 m_lockedVisibility = state;
68 inline virtual bool isSelected()
const {
return m_selected; }
70 inline virtual void setSelected(
bool state) { m_selected = state; }
77 virtual void getDrawingParameters(
glDrawParams& params)
const;
80 inline virtual bool hasColors()
const {
return false; }
82 inline virtual bool colorsShown()
const {
return m_colorsDisplayed; }
84 inline virtual void showColors(
bool state) { m_colorsDisplayed = state; }
91 inline virtual bool normalsShown()
const {
return m_normalsDisplayed; }
93 inline virtual void showNormals(
bool state) { m_normalsDisplayed = state; }
109 m_sfDisplayed = state;
114 inline virtual void toggleSF() { showSF(!sfShown()); }
117 inline virtual bool sfShown()
const {
return m_sfDisplayed; }
125 inline virtual void showNameIn3D(
bool state) { m_showNameIn3D = state; }
139 return m_colorIsOverridden;
152 bool autoActivate =
true);
156 m_colorIsOverridden = state;
160 inline virtual float getOpacity()
const {
return m_opacity; }
178 virtual void setGLTransformation(
const ccGLMatrix& trans);
183 virtual void enableGLTransformation(
bool state);
200 virtual void resetGLTransformation();
207 virtual void rotateGL(
const ccGLMatrix& rotMat);
214 virtual void translateGL(
const CCVector3& trans);
223 virtual bool addClipPlanes(
const ccClipPlane& plane);
237 using Shared = QSharedPointer<DisplayState>;
239 bool visible =
false;
240 bool colorsDisplayed =
false;
241 bool normalsDisplayed =
false;
242 bool sfDisplayed =
false;
243 bool colorIsOverridden =
false;
244 bool showNameIn3D =
false;
248 virtual bool pushDisplayState();
251 virtual void popDisplayState(
bool apply =
true);
254 virtual void applyDisplayState(
const DisplayState& state);
Generic interface for (3D) drawable entities.
virtual void toggleVisibility()
Toggles visibility.
virtual bool colorsShown() const
Returns whether colors are shown or not.
bool m_sfDisplayed
Specifies whether scalar field should be displayed.
virtual float getOpacity() const
virtual bool isVisible() const
Returns whether entity is visible or not.
virtual bool isVisibilityLocked() const
Returns whether visibility is locked or not.
virtual bool hasDisplayedScalarField() const
Returns whether an active scalar field is available or not.
bool m_colorsDisplayed
Specifies whether colors should be displayed.
virtual void toggleNormals()
Toggles normals display state.
virtual bool hasColors() const
Returns whether colors are enabled or not.
virtual void lockVisibility(bool state)
Locks/unlocks visibility.
virtual void setVisible(bool state)
Sets entity visibility.
virtual bool sfShown() const
Returns whether active scalar field is visible.
bool m_visible
Specifies whether the object is visible or not.
virtual bool isGLTransEnabled() const
Returns whether a GL transformation is enabled or not.
virtual bool normalsShown() const
Returns whether normals are shown or not.
virtual const ccGLMatrix & getGLTransformation() const
Returns associated GL transformation.
virtual bool hasNormals() const
Returns whether normals are enabled or not.
bool m_glTransEnabled
Current GL transformation activation state.
virtual void setRedraw(bool state)
Sets entity redraw mode.
virtual bool isColorOverridden() const
virtual void toggleSF()
Toggles SF display state.
ccGLMatrix m_glTrans
Current GL transformation.
virtual void toggleMaterials()
Toggles material display state.
virtual void toggleColors()
Toggles colors display state.
virtual bool isSelected() const
Returns whether entity is selected or not.
virtual void setFixedId(bool state)
bool m_selected
Specifies whether the object is selected or not.
virtual void toggleShowName()
Toggles name in 3D display state.
virtual void showNameIn3D(bool state)
Sets whether name should be displayed in 3D.
CCVector3d m_nameIn3DPos
Last 2D position of the '3D' name.
virtual bool nameShownIn3D() const
Returns whether name is displayed in 3D or not.
virtual void enableTempColor(bool state)
Set temporary color activation state.
virtual void removeAllClipPlanes()
Removes all clipping planes (if any)
virtual void showNormals(bool state)
Sets normals visibility.
bool m_lockedVisibility
Specifies whether the visibility can be changed by user or not.
virtual bool isRedraw() const
Returns whether entity is to be redraw.
std::vector< DisplayState::Shared > m_displayStateStack
The stack of pushed display states.
bool m_showNameIn3D
Whether name is displayed in 3D or not.
virtual void showColors(bool state)
Sets colors visibility.
virtual void showSF(bool state)
Sets active scalarfield visibility.
virtual void setForceRedraw(bool state)
Sets force redraw.
virtual const ecvColor::Rgb & getTempColor() const
Returns current temporary (unique) color.
virtual void setOpacity(float opacity)
Set opacity activation state.
bool m_colorIsOverridden
Temporary (unique) color activation state.
virtual bool hasScalarFields() const
Returns whether one or more scalar fields are instantiated.
virtual void draw(CC_DRAW_CONTEXT &context)=0
Draws entity and its children.
bool m_normalsDisplayed
Specifies whether normals should be displayed.
ccClipPlaneSet m_clipPlanes
Active clipping planes (used for display only)
ecvColor::Rgb m_tempColor
Temporary (unique) color.
virtual ~ccDrawableObject()=default
virtual void setSelected(bool state)
Selects/Unselects entity.
Float version of ccGLMatrixTpl.
std::vector< ccClipPlane > ccClipPlaneSet
Simple (clipping) plane equation.
Tuple4Tpl< double > equation
QSharedPointer< DisplayState > Shared
Display parameters of a 3D entity.