Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
V3d_Viewer Class Reference

Defines services on Viewer type objects. The methods of this class allow editing and interrogation of the parameters linked to the viewer its friend classes (View,light,plane). More...

#include <V3d_Viewer.hxx>

Inheritance diagram for V3d_Viewer:
Inheritance graph
[legend]

Public Member Functions

 V3d_Viewer (const occ::handle< Graphic3d_GraphicDriver > &theDriver)
 Create a Viewer with the given graphic driver and with default parameters:
 
bool IfMoreViews () const
 Returns True if One View more can be defined in this Viewer.
 
occ::handle< V3d_ViewCreateView ()
 Creates a view in the viewer according to its default parameters.
 
void SetViewOn ()
 Activates all of the views of a viewer attached to a window.
 
void SetViewOn (const occ::handle< V3d_View > &theView)
 Activates a particular view in the Viewer. Must be call if the Window attached to the view has been Deiconified.
 
void SetViewOff ()
 Deactivates all the views of a Viewer attached to a window.
 
void SetViewOff (const occ::handle< V3d_View > &theView)
 Deactivates a particular view in the Viewer. Must be call if the Window attached to the view has been Iconified .
 
void Update ()
 Deprecated, Redraw() should be used instead.
 
void Redraw () const
 Redraws all the views of the Viewer even if no modification has taken place. Must be called if all the views of the Viewer are exposed, as for example in a global DeIconification.
 
void RedrawImmediate () const
 Updates layer of immediate presentations.
 
void Invalidate () const
 Invalidates viewer content but does not redraw it.
 
void Remove ()
 Suppresses the Viewer.
 
const occ::handle< Graphic3d_GraphicDriver > & Driver () const
 Return Graphic Driver instance.
 
occ::handle< Graphic3d_StructureManagerStructureManager () const
 Returns the structure manager associated to this viewer.
 
const Graphic3d_RenderingParamsDefaultRenderingParams () const
 Return default Rendering Parameters. By default these parameters are set in a new V3d_View.
 
void SetDefaultRenderingParams (const Graphic3d_RenderingParams &theParams)
 Set default Rendering Parameters.
 
void SetDefaultBackgroundColor (const Quantity_Color &theColor)
 Defines the default background colour of views attached to the viewer by supplying the color object.
 
const Aspect_GradientBackgroundGetGradientBackground () const
 Returns the gradient background of the view.
 
void SetDefaultBgGradientColors (const Quantity_Color &theColor1, const Quantity_Color &theColor2, const Aspect_GradientFillMethod theFillStyle=Aspect_GradientFillMethod_Horizontal)
 Defines the default gradient background colours of views attached to the viewer by supplying the colour objects.
 
double DefaultViewSize () const
 Returns the default size of the view.
 
void SetDefaultViewSize (const double theSize)
 Gives a default size for the creation of views of the viewer.
 
V3d_TypeOfOrientation DefaultViewProj () const
 Returns the default Projection.
 
void SetDefaultViewProj (const V3d_TypeOfOrientation theOrientation)
 Sets the default projection for creating views in the viewer.
 
V3d_TypeOfVisualization DefaultVisualization () const
 Returns the default type of Visualization.
 
void SetDefaultVisualization (const V3d_TypeOfVisualization theType)
 Gives the default visualization mode.
 
Graphic3d_TypeOfShadingModel DefaultShadingModel () const
 Returns the default type of Shading; Graphic3d_TypeOfShadingModel_Phong by default.
 
void SetDefaultShadingModel (const Graphic3d_TypeOfShadingModel theType)
 Gives the default type of SHADING.
 
V3d_TypeOfView DefaultTypeOfView () const
 Returns the default type of View (orthographic or perspective projection) to be returned by CreateView() method.
 
void SetDefaultTypeOfView (const V3d_TypeOfView theType)
 Set the default type of View (orthographic or perspective projection) to be returned by CreateView() method.
 
Quantity_Color DefaultBackgroundColor () const
 Returns the default background colour object.
 
void DefaultBgGradientColors (Quantity_Color &theColor1, Quantity_Color &theColor2) const
 Returns the gradient background colour objects of the view.
 
void GetAllZLayers (NCollection_Sequence< int > &theLayerSeq) const
 Return all Z layer ids in sequence ordered by overlay level from lowest layer to highest ( foreground ). The first layer ID in sequence is the default layer that can't be removed.
 
bool AddZLayer (Graphic3d_ZLayerId &theLayerId, const Graphic3d_ZLayerSettings &theSettings=Graphic3d_ZLayerSettings())
 Add a new top-level Z layer to all managed views and get its ID as <theLayerId> value. The Z layers are controlled entirely by viewer, it is not possible to add a layer to a particular view. Custom layers will be inserted before Graphic3d_ZLayerId_Top (e.g. between Graphic3d_ZLayerId_Default and before Graphic3d_ZLayerId_Top).
 
bool InsertLayerBefore (Graphic3d_ZLayerId &theNewLayerId, const Graphic3d_ZLayerSettings &theSettings, const Graphic3d_ZLayerId theLayerAfter)
 Add a new top-level Z layer to all managed views and get its ID as <theLayerId> value. The Z layers are controlled entirely by viewer, it is not possible to add a layer to a particular view. Layer rendering order is defined by its position in list (altered by theLayerAfter) and IsImmediate() flag (all layers with IsImmediate() flag are drawn afterwards);.
 
bool InsertLayerAfter (Graphic3d_ZLayerId &theNewLayerId, const Graphic3d_ZLayerSettings &theSettings, const Graphic3d_ZLayerId theLayerBefore)
 Add a new top-level Z layer to all managed views and get its ID as <theLayerId> value. The Z layers are controlled entirely by viewer, it is not possible to add a layer to a particular view. Layer rendering order is defined by its position in list (altered by theLayerAfter) and IsImmediate() flag (all layers with IsImmediate() flag are drawn afterwards);.
 
bool RemoveZLayer (const Graphic3d_ZLayerId theLayerId)
 Remove Z layer with ID <theLayerId>. Method returns false if the layer can not be removed or doesn't exists. By default, there are always default bottom-level layer that can't be removed.
 
const Graphic3d_ZLayerSettingsZLayerSettings (const Graphic3d_ZLayerId theLayerId) const
 Returns the settings of a single Z layer.
 
void SetZLayerSettings (const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings &theSettings)
 Sets the settings for a single Z layer.
 
const NCollection_List< occ::handle< V3d_View > > & ActiveViews () const
 Return a list of active views.
 
NCollection_List< occ::handle< V3d_View > >::Iterator ActiveViewIterator () const
 Return an iterator for active views.
 
bool LastActiveView () const
 returns true if there is only one active view.
 
const NCollection_List< occ::handle< V3d_View > > & DefinedViews () const
 Return a list of defined views.
 
NCollection_List< occ::handle< V3d_View > >::Iterator DefinedViewIterator () const
 Return an iterator for defined views.
 
lights management

Defines default lights: positional-light 0.3 0. 0. directional-light V3d_XnegYposZpos directional-light V3d_XnegYneg ambient-light

void SetDefaultLights ()
 Activates MyLight in the viewer.
 
void SetLightOn (const occ::handle< V3d_Light > &theLight)
 Activates MyLight in the viewer.
 
void SetLightOn ()
 Activates all the lights defined in this viewer.
 
void SetLightOff (const occ::handle< V3d_Light > &theLight)
 Deactivates MyLight in this viewer.
 
void SetLightOff ()
 Deactivate all the Lights defined in this viewer.
 
void AddLight (const occ::handle< V3d_Light > &theLight)
 Adds Light in Sequence Of Lights.
 
void DelLight (const occ::handle< V3d_Light > &theLight)
 Delete Light in Sequence Of Lights.
 
void UpdateLights ()
 Updates the lights of all the views of a viewer.
 
bool IsGlobalLight (const occ::handle< V3d_Light > &TheLight) const
 Activates MyLight in the viewer.
 
const NCollection_List< occ::handle< Graphic3d_CLight > > & ActiveLights () const
 Return a list of active lights.
 
NCollection_List< occ::handle< Graphic3d_CLight > >::Iterator ActiveLightIterator () const
 Return an iterator for defined lights.
 
const NCollection_List< occ::handle< Graphic3d_CLight > > & DefinedLights () const
 Return a list of defined lights.
 
NCollection_List< occ::handle< Graphic3d_CLight > >::Iterator DefinedLightIterator () const
 Return an iterator for defined lights.
 
objects management

Erase all Objects in All the views.

void Erase () const
 UnHighlight all Objects in All the views.
 
void UnHighlight () const
 UnHighlight all Objects in All the views.
 
bool ComputedMode () const
 returns true if the computed mode can be used.
 
void SetComputedMode (const bool theMode)
 Set if the computed mode can be used.
 
bool DefaultComputedMode () const
 returns true if by default the computed mode must be used.
 
void SetDefaultComputedMode (const bool theMode)
 Set if by default the computed mode must be used.
 
privileged plane management
const gp_Ax3PrivilegedPlane () const
 
void SetPrivilegedPlane (const gp_Ax3 &thePlane)
 
void DisplayPrivilegedPlane (const bool theOnOff, const double theSize=1)
 
grid management (CPU rendering, deprecated)

GPU shader grid lives on V3d_View::GridDisplay (mutually exclusive with this path). Arc range on circular grids is unsupported here: warning + ignored.

void ActivateGrid (const Aspect_GridType aGridType, const Aspect_GridDrawMode aGridDrawMode)
 Activates the grid in all views of <me>. Lazily creates the V3d_RectangularGrid / V3d_CircularGrid on first use and displays it.
 
void DeactivateGrid ()
 Deactivates the grid in all views of <me>.
 
bool IsGridActive ()
 Returns true if a grid is currently active in <me>.
 
occ::handle< Aspect_GridGrid (bool theToCreate=true)
 Returns the currently selected grid (rectangular / circular per GridType()).
 
occ::handle< Aspect_GridGrid (Aspect_GridType theGridType, bool theToCreate=true)
 Returns the grid of the requested type.
 
Aspect_GridType GridType () const
 Returns the currently selected grid type (rectangular / circular).
 
Aspect_GridDrawMode GridDrawMode ()
 Returns the draw mode (lines / points / none) of the active grid.
 
void RectangularGridValues (double &theXOrigin, double &theYOrigin, double &theXStep, double &theYStep, double &theRotationAngle)
 Returns the rectangular grid definition.
 
void SetRectangularGridValues (const double XOrigin, const double YOrigin, const double XStep, const double YStep, const double RotationAngle)
 Sets the rectangular grid definition.
 
void RectangularGridGraphicValues (double &theXSize, double &theYSize, double &theOffSet)
 Returns the rectangular grid extent.
 
void SetRectangularGridGraphicValues (const double XSize, const double YSize, const double OffSet)
 Sets the rectangular grid extent.
 
void CircularGridValues (double &theXOrigin, double &theYOrigin, double &theRadiusStep, int &theDivisionNumber, double &theRotationAngle)
 Returns the circular grid definition.
 
void SetCircularGridValues (const double XOrigin, const double YOrigin, const double RadiusStep, const int DivisionNumber, const double RotationAngle)
 Sets the circular grid definition.
 
void CircularGridGraphicValues (double &theRadius, double &theOffSet)
 Returns the circular grid extent.
 
void SetCircularGridGraphicValues (const double Radius, const double OffSet)
 Sets the circular grid extent.
 
void SetGridEcho (const bool showGrid=true)
 Toggle the snap-hit echo marker drawn by ConvertToGrid() at the snapped point.
 
void SetGridEcho (const occ::handle< Graphic3d_AspectMarker3d > &aMarker)
 Replaces the default echo marker. Default attributes when this overload is not called: Aspect_TOM_STAR, Quantity_NOC_GRAY90, size 3.0.
 
bool GridEcho () const
 Returns TRUE when the snap-hit echo marker is enabled.
 
void ShowGridEcho (const occ::handle< V3d_View > &theView, const Graphic3d_Vertex &thePoint)
 Displays the echo marker in a single view.
 
void HideGridEcho (const occ::handle< V3d_View > &theView)
 Temporarily hides the echo marker in a single view (e.g. while not snapping).
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
bool IsKind (const char *const theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

deprecated methods

Returns true if a grid is activated in <me>.

Deprecated
("Deprecated method - IsGridActive() should be used instead")
bool IsActive ()
 Initializes an internal iterator on the active views.
 
void InitActiveViews ()
 Initializes an internal iterator on the active views.
 
bool MoreActiveViews () const
 Returns true if there are more active view(s) to return.
 
void NextActiveViews ()
 Go to the next active view (if there is not, ActiveView will raise an exception)
 
const occ::handle< V3d_View > & ActiveView () const
 
void InitDefinedViews ()
 Initializes an internal iterator on the Defined views.
 
bool MoreDefinedViews () const
 returns true if there are more Defined view(s) to return.
 
void NextDefinedViews ()
 Go to the next Defined view (if there is not, DefinedView will raise an exception)
 
const occ::handle< V3d_View > & DefinedView () const
 
void InitActiveLights ()
 Initializes an internal iteratator on the active Lights.
 
bool MoreActiveLights () const
 returns true if there are more active Light(s) to return.
 
void NextActiveLights ()
 Go to the next active Light (if there is not, ActiveLight() will raise an exception)
 
const occ::handle< V3d_Light > & ActiveLight () const
 
void InitDefinedLights ()
 Initializes an internal iterattor on the Defined Lights.
 
bool MoreDefinedLights () const
 Returns true if there are more Defined Light(s) to return.
 
void NextDefinedLights ()
 Go to the next Defined Light (if there is not, DefinedLight() will raise an exception)
 
const occ::handle< V3d_Light > & DefinedLight () const
 
void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
 Dumps the content of me into the stream.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

Detailed Description

Defines services on Viewer type objects. The methods of this class allow editing and interrogation of the parameters linked to the viewer its friend classes (View,light,plane).

Constructor & Destructor Documentation

◆ V3d_Viewer()

V3d_Viewer::V3d_Viewer ( const occ::handle< Graphic3d_GraphicDriver > & theDriver)

Create a Viewer with the given graphic driver and with default parameters:

  • View orientation: V3d_XposYnegZpos
  • View background: Quantity_NOC_GRAY30
  • Shading model: V3d_GOURAUD

Member Function Documentation

◆ ActivateGrid()

void V3d_Viewer::ActivateGrid ( const Aspect_GridType aGridType,
const Aspect_GridDrawMode aGridDrawMode )

Activates the grid in all views of <me>. Lazily creates the V3d_RectangularGrid / V3d_CircularGrid on first use and displays it.

Parameters
[in]aGridTyperectangular or circular
[in]aGridDrawModelines, points or none

◆ ActiveLight()

const occ::handle< V3d_Light > & V3d_Viewer::ActiveLight ( ) const
inline
Deprecated
("Deprecated method - ActiveLights() should be used instead")

◆ ActiveLightIterator()

NCollection_List< occ::handle< Graphic3d_CLight > >::Iterator V3d_Viewer::ActiveLightIterator ( ) const
inline

Return an iterator for defined lights.

◆ ActiveLights()

const NCollection_List< occ::handle< Graphic3d_CLight > > & V3d_Viewer::ActiveLights ( ) const
inline

Return a list of active lights.

◆ ActiveView()

const occ::handle< V3d_View > & V3d_Viewer::ActiveView ( ) const
inline
Deprecated
("Deprecated method - ActiveViews() should be used instead")

◆ ActiveViewIterator()

NCollection_List< occ::handle< V3d_View > >::Iterator V3d_Viewer::ActiveViewIterator ( ) const
inline

Return an iterator for active views.

◆ ActiveViews()

const NCollection_List< occ::handle< V3d_View > > & V3d_Viewer::ActiveViews ( ) const
inline

Return a list of active views.

◆ AddLight()

void V3d_Viewer::AddLight ( const occ::handle< V3d_Light > & theLight)

Adds Light in Sequence Of Lights.

◆ AddZLayer()

bool V3d_Viewer::AddZLayer ( Graphic3d_ZLayerId & theLayerId,
const Graphic3d_ZLayerSettings & theSettings = Graphic3d_ZLayerSettings() )
inline

Add a new top-level Z layer to all managed views and get its ID as <theLayerId> value. The Z layers are controlled entirely by viewer, it is not possible to add a layer to a particular view. Custom layers will be inserted before Graphic3d_ZLayerId_Top (e.g. between Graphic3d_ZLayerId_Default and before Graphic3d_ZLayerId_Top).

Parameters
[out]theLayerIdid of created layer
[in]theSettingsnew layer settings
Returns
FALSE if the layer can not be created

◆ CircularGridGraphicValues()

void V3d_Viewer::CircularGridGraphicValues ( double & theRadius,
double & theOffSet )

Returns the circular grid extent.

Parameters
[out]theRadiusoutermost ring radius
[out]theOffSetplane-normal displacement of the rendered grid

◆ CircularGridValues()

void V3d_Viewer::CircularGridValues ( double & theXOrigin,
double & theYOrigin,
double & theRadiusStep,
int & theDivisionNumber,
double & theRotationAngle )

Returns the circular grid definition.

Parameters
[out]theXOrigingrid origin X (snap reference)
[out]theYOrigingrid origin Y
[out]theRadiusStepradial interval between two concentric circles
[out]theDivisionNumbernumber of sectors per half-circle
[out]theRotationAnglein-plane rotation angle, radians

◆ ComputedMode()

bool V3d_Viewer::ComputedMode ( ) const
inline

returns true if the computed mode can be used.

◆ CreateView()

occ::handle< V3d_View > V3d_Viewer::CreateView ( )

Creates a view in the viewer according to its default parameters.

◆ DeactivateGrid()

void V3d_Viewer::DeactivateGrid ( )

Deactivates the grid in all views of <me>.

◆ DefaultBackgroundColor()

Quantity_Color V3d_Viewer::DefaultBackgroundColor ( ) const
inline

Returns the default background colour object.

◆ DefaultBgGradientColors()

void V3d_Viewer::DefaultBgGradientColors ( Quantity_Color & theColor1,
Quantity_Color & theColor2 ) const
inline

Returns the gradient background colour objects of the view.

◆ DefaultComputedMode()

bool V3d_Viewer::DefaultComputedMode ( ) const
inline

returns true if by default the computed mode must be used.

◆ DefaultRenderingParams()

const Graphic3d_RenderingParams & V3d_Viewer::DefaultRenderingParams ( ) const
inline

Return default Rendering Parameters. By default these parameters are set in a new V3d_View.

◆ DefaultShadingModel()

Graphic3d_TypeOfShadingModel V3d_Viewer::DefaultShadingModel ( ) const
inline

Returns the default type of Shading; Graphic3d_TypeOfShadingModel_Phong by default.

◆ DefaultTypeOfView()

V3d_TypeOfView V3d_Viewer::DefaultTypeOfView ( ) const
inline

Returns the default type of View (orthographic or perspective projection) to be returned by CreateView() method.

◆ DefaultViewProj()

V3d_TypeOfOrientation V3d_Viewer::DefaultViewProj ( ) const
inline

Returns the default Projection.

◆ DefaultViewSize()

double V3d_Viewer::DefaultViewSize ( ) const
inline

Returns the default size of the view.

◆ DefaultVisualization()

V3d_TypeOfVisualization V3d_Viewer::DefaultVisualization ( ) const
inline

Returns the default type of Visualization.

◆ DefinedLight()

const occ::handle< V3d_Light > & V3d_Viewer::DefinedLight ( ) const
inline
Deprecated
("Deprecated method - DefinedLights() should be used instead")

◆ DefinedLightIterator()

NCollection_List< occ::handle< Graphic3d_CLight > >::Iterator V3d_Viewer::DefinedLightIterator ( ) const
inline

Return an iterator for defined lights.

◆ DefinedLights()

const NCollection_List< occ::handle< Graphic3d_CLight > > & V3d_Viewer::DefinedLights ( ) const
inline

Return a list of defined lights.

◆ DefinedView()

const occ::handle< V3d_View > & V3d_Viewer::DefinedView ( ) const
inline
Deprecated
("Deprecated method - DefinedViews() should be used instead")

◆ DefinedViewIterator()

NCollection_List< occ::handle< V3d_View > >::Iterator V3d_Viewer::DefinedViewIterator ( ) const
inline

Return an iterator for defined views.

◆ DefinedViews()

const NCollection_List< occ::handle< V3d_View > > & V3d_Viewer::DefinedViews ( ) const
inline

Return a list of defined views.

◆ DelLight()

void V3d_Viewer::DelLight ( const occ::handle< V3d_Light > & theLight)

Delete Light in Sequence Of Lights.

◆ DisplayPrivilegedPlane()

void V3d_Viewer::DisplayPrivilegedPlane ( const bool theOnOff,
const double theSize = 1 )

◆ Driver()

const occ::handle< Graphic3d_GraphicDriver > & V3d_Viewer::Driver ( ) const
inline

Return Graphic Driver instance.

◆ DumpJson()

void V3d_Viewer::DumpJson ( Standard_OStream & theOStream,
int theDepth = -1 ) const

Dumps the content of me into the stream.

◆ Erase()

void V3d_Viewer::Erase ( ) const

UnHighlight all Objects in All the views.

◆ GetAllZLayers()

void V3d_Viewer::GetAllZLayers ( NCollection_Sequence< int > & theLayerSeq) const

Return all Z layer ids in sequence ordered by overlay level from lowest layer to highest ( foreground ). The first layer ID in sequence is the default layer that can't be removed.

◆ GetGradientBackground()

const Aspect_GradientBackground & V3d_Viewer::GetGradientBackground ( ) const
inline

Returns the gradient background of the view.

◆ Grid() [1/2]

occ::handle< Aspect_Grid > V3d_Viewer::Grid ( Aspect_GridType theGridType,
bool theToCreate = true )

Returns the grid of the requested type.

Parameters
[in]theGridTyperectangular or circular
[in]theToCreatewhen false, returns null instead of allocating

◆ Grid() [2/2]

occ::handle< Aspect_Grid > V3d_Viewer::Grid ( bool theToCreate = true)
inline

Returns the currently selected grid (rectangular / circular per GridType()).

Parameters
[in]theToCreatewhen false, returns null instead of allocating

◆ GridDrawMode()

Aspect_GridDrawMode V3d_Viewer::GridDrawMode ( )

Returns the draw mode (lines / points / none) of the active grid.

◆ GridEcho()

bool V3d_Viewer::GridEcho ( ) const
inline

Returns TRUE when the snap-hit echo marker is enabled.

◆ GridType()

Aspect_GridType V3d_Viewer::GridType ( ) const
inline

Returns the currently selected grid type (rectangular / circular).

◆ HideGridEcho()

void V3d_Viewer::HideGridEcho ( const occ::handle< V3d_View > & theView)

Temporarily hides the echo marker in a single view (e.g. while not snapping).

Parameters
[in]theViewview in which to hide the echo

◆ IfMoreViews()

bool V3d_Viewer::IfMoreViews ( ) const

Returns True if One View more can be defined in this Viewer.

◆ InitActiveLights()

void V3d_Viewer::InitActiveLights ( )
inline

Initializes an internal iteratator on the active Lights.

Deprecated
("Deprecated method - ActiveLights() should be used instead")

◆ InitActiveViews()

void V3d_Viewer::InitActiveViews ( )
inline

Initializes an internal iterator on the active views.

Deprecated
("Deprecated method - ActiveViews() should be used instead")

◆ InitDefinedLights()

void V3d_Viewer::InitDefinedLights ( )
inline

Initializes an internal iterattor on the Defined Lights.

Deprecated
("Deprecated method - DefinedLights() should be used instead")

◆ InitDefinedViews()

void V3d_Viewer::InitDefinedViews ( )
inline

Initializes an internal iterator on the Defined views.

Deprecated
("Deprecated method - DefinedViews() should be used instead")

◆ InsertLayerAfter()

bool V3d_Viewer::InsertLayerAfter ( Graphic3d_ZLayerId & theNewLayerId,
const Graphic3d_ZLayerSettings & theSettings,
const Graphic3d_ZLayerId theLayerBefore )

Add a new top-level Z layer to all managed views and get its ID as <theLayerId> value. The Z layers are controlled entirely by viewer, it is not possible to add a layer to a particular view. Layer rendering order is defined by its position in list (altered by theLayerAfter) and IsImmediate() flag (all layers with IsImmediate() flag are drawn afterwards);.

Parameters
[out]theNewLayerIdid of created layer; layer id is arbitrary and does not depend on layer position in the list
[in]theSettingsnew layer settings
[in]theLayerBeforeid of layer to append new layer after
Returns
FALSE if the layer can not be created

◆ InsertLayerBefore()

bool V3d_Viewer::InsertLayerBefore ( Graphic3d_ZLayerId & theNewLayerId,
const Graphic3d_ZLayerSettings & theSettings,
const Graphic3d_ZLayerId theLayerAfter )

Add a new top-level Z layer to all managed views and get its ID as <theLayerId> value. The Z layers are controlled entirely by viewer, it is not possible to add a layer to a particular view. Layer rendering order is defined by its position in list (altered by theLayerAfter) and IsImmediate() flag (all layers with IsImmediate() flag are drawn afterwards);.

Parameters
[out]theNewLayerIdid of created layer; layer id is arbitrary and does not depend on layer position in the list
[in]theSettingsnew layer settings
[in]theLayerAfterid of layer to append new layer before
Returns
FALSE if the layer can not be created

◆ Invalidate()

void V3d_Viewer::Invalidate ( ) const

Invalidates viewer content but does not redraw it.

◆ IsActive()

bool V3d_Viewer::IsActive ( )
inline

Initializes an internal iterator on the active views.

Deprecated
("Deprecated method - ActiveViews() should be used instead")

◆ IsGlobalLight()

bool V3d_Viewer::IsGlobalLight ( const occ::handle< V3d_Light > & TheLight) const

Activates MyLight in the viewer.

◆ IsGridActive()

bool V3d_Viewer::IsGridActive ( )

Returns true if a grid is currently active in <me>.

◆ LastActiveView()

bool V3d_Viewer::LastActiveView ( ) const
inline

returns true if there is only one active view.

◆ MoreActiveLights()

bool V3d_Viewer::MoreActiveLights ( ) const
inline

returns true if there are more active Light(s) to return.

Deprecated
("Deprecated method - ActiveLights() should be used instead")

◆ MoreActiveViews()

bool V3d_Viewer::MoreActiveViews ( ) const
inline

Returns true if there are more active view(s) to return.

Deprecated
("Deprecated method - ActiveViews() should be used instead")

◆ MoreDefinedLights()

bool V3d_Viewer::MoreDefinedLights ( ) const
inline

Returns true if there are more Defined Light(s) to return.

Deprecated
("Deprecated method - DefinedLights() should be used instead")

◆ MoreDefinedViews()

bool V3d_Viewer::MoreDefinedViews ( ) const
inline

returns true if there are more Defined view(s) to return.

Deprecated
("Deprecated method - DefinedViews() should be used instead")

◆ NextActiveLights()

void V3d_Viewer::NextActiveLights ( )
inline

Go to the next active Light (if there is not, ActiveLight() will raise an exception)

Deprecated
("Deprecated method - ActiveLights() should be used instead")

◆ NextActiveViews()

void V3d_Viewer::NextActiveViews ( )
inline

Go to the next active view (if there is not, ActiveView will raise an exception)

Deprecated
("Deprecated method - ActiveViews() should be used instead")

◆ NextDefinedLights()

void V3d_Viewer::NextDefinedLights ( )
inline

Go to the next Defined Light (if there is not, DefinedLight() will raise an exception)

Deprecated
("Deprecated method - DefinedLights() should be used instead")

◆ NextDefinedViews()

void V3d_Viewer::NextDefinedViews ( )
inline

Go to the next Defined view (if there is not, DefinedView will raise an exception)

Deprecated
("Deprecated method - DefinedViews() should be used instead")

◆ PrivilegedPlane()

const gp_Ax3 & V3d_Viewer::PrivilegedPlane ( ) const
inline

◆ RectangularGridGraphicValues()

void V3d_Viewer::RectangularGridGraphicValues ( double & theXSize,
double & theYSize,
double & theOffSet )

Returns the rectangular grid extent.

Parameters
[out]theXSizewidth along grid X
[out]theYSizeheight along grid Y
[out]theOffSetplane-normal displacement of the rendered grid

◆ RectangularGridValues()

void V3d_Viewer::RectangularGridValues ( double & theXOrigin,
double & theYOrigin,
double & theXStep,
double & theYStep,
double & theRotationAngle )

Returns the rectangular grid definition.

Parameters
[out]theXOrigingrid origin X (snap reference)
[out]theYOrigingrid origin Y
[out]theXStepinterval between two vertical lines
[out]theYStepinterval between two horizontal lines
[out]theRotationAnglein-plane rotation angle, radians

◆ Redraw()

void V3d_Viewer::Redraw ( ) const

Redraws all the views of the Viewer even if no modification has taken place. Must be called if all the views of the Viewer are exposed, as for example in a global DeIconification.

◆ RedrawImmediate()

void V3d_Viewer::RedrawImmediate ( ) const

Updates layer of immediate presentations.

◆ Remove()

void V3d_Viewer::Remove ( )

Suppresses the Viewer.

◆ RemoveZLayer()

bool V3d_Viewer::RemoveZLayer ( const Graphic3d_ZLayerId theLayerId)

Remove Z layer with ID <theLayerId>. Method returns false if the layer can not be removed or doesn't exists. By default, there are always default bottom-level layer that can't be removed.

◆ SetCircularGridGraphicValues()

void V3d_Viewer::SetCircularGridGraphicValues ( const double Radius,
const double OffSet )

Sets the circular grid extent.

Parameters
[in]Radiusoutermost ring radius
[in]OffSetplane-normal displacement

◆ SetCircularGridValues()

void V3d_Viewer::SetCircularGridValues ( const double XOrigin,
const double YOrigin,
const double RadiusStep,
const int DivisionNumber,
const double RotationAngle )

Sets the circular grid definition.

Parameters
[in]XOrigingrid origin X
[in]YOrigingrid origin Y
[in]RadiusStepradial interval between two concentric circles
[in]DivisionNumbernumber of sectors per half-circle (>= 1)
[in]RotationAnglein-plane rotation angle, radians

◆ SetComputedMode()

void V3d_Viewer::SetComputedMode ( const bool theMode)
inline

Set if the computed mode can be used.

◆ SetDefaultBackgroundColor()

void V3d_Viewer::SetDefaultBackgroundColor ( const Quantity_Color & theColor)
inline

Defines the default background colour of views attached to the viewer by supplying the color object.

◆ SetDefaultBgGradientColors()

void V3d_Viewer::SetDefaultBgGradientColors ( const Quantity_Color & theColor1,
const Quantity_Color & theColor2,
const Aspect_GradientFillMethod theFillStyle = Aspect_GradientFillMethod_Horizontal )
inline

Defines the default gradient background colours of views attached to the viewer by supplying the colour objects.

◆ SetDefaultComputedMode()

void V3d_Viewer::SetDefaultComputedMode ( const bool theMode)
inline

Set if by default the computed mode must be used.

◆ SetDefaultLights()

void V3d_Viewer::SetDefaultLights ( )

Activates MyLight in the viewer.

◆ SetDefaultRenderingParams()

void V3d_Viewer::SetDefaultRenderingParams ( const Graphic3d_RenderingParams & theParams)
inline

Set default Rendering Parameters.

◆ SetDefaultShadingModel()

void V3d_Viewer::SetDefaultShadingModel ( const Graphic3d_TypeOfShadingModel theType)
inline

Gives the default type of SHADING.

◆ SetDefaultTypeOfView()

void V3d_Viewer::SetDefaultTypeOfView ( const V3d_TypeOfView theType)
inline

Set the default type of View (orthographic or perspective projection) to be returned by CreateView() method.

◆ SetDefaultViewProj()

void V3d_Viewer::SetDefaultViewProj ( const V3d_TypeOfOrientation theOrientation)
inline

Sets the default projection for creating views in the viewer.

◆ SetDefaultViewSize()

void V3d_Viewer::SetDefaultViewSize ( const double theSize)

Gives a default size for the creation of views of the viewer.

◆ SetDefaultVisualization()

void V3d_Viewer::SetDefaultVisualization ( const V3d_TypeOfVisualization theType)
inline

Gives the default visualization mode.

◆ SetGridEcho() [1/2]

void V3d_Viewer::SetGridEcho ( const bool showGrid = true)

Toggle the snap-hit echo marker drawn by ConvertToGrid() at the snapped point.

Parameters
[in]showGridwhen TRUE, the marker is shown on every snap hit

◆ SetGridEcho() [2/2]

void V3d_Viewer::SetGridEcho ( const occ::handle< Graphic3d_AspectMarker3d > & aMarker)

Replaces the default echo marker. Default attributes when this overload is not called: Aspect_TOM_STAR, Quantity_NOC_GRAY90, size 3.0.

Parameters
[in]aMarkercustom marker aspect to use for echo display

◆ SetLightOff() [1/2]

void V3d_Viewer::SetLightOff ( )

Deactivate all the Lights defined in this viewer.

◆ SetLightOff() [2/2]

void V3d_Viewer::SetLightOff ( const occ::handle< V3d_Light > & theLight)

Deactivates MyLight in this viewer.

◆ SetLightOn() [1/2]

void V3d_Viewer::SetLightOn ( )

Activates all the lights defined in this viewer.

◆ SetLightOn() [2/2]

void V3d_Viewer::SetLightOn ( const occ::handle< V3d_Light > & theLight)

Activates MyLight in the viewer.

◆ SetPrivilegedPlane()

void V3d_Viewer::SetPrivilegedPlane ( const gp_Ax3 & thePlane)

◆ SetRectangularGridGraphicValues()

void V3d_Viewer::SetRectangularGridGraphicValues ( const double XSize,
const double YSize,
const double OffSet )

Sets the rectangular grid extent.

Parameters
[in]XSizewidth along grid X
[in]YSizeheight along grid Y
[in]OffSetplane-normal displacement

◆ SetRectangularGridValues()

void V3d_Viewer::SetRectangularGridValues ( const double XOrigin,
const double YOrigin,
const double XStep,
const double YStep,
const double RotationAngle )

Sets the rectangular grid definition.

Parameters
[in]XOrigingrid origin X
[in]YOrigingrid origin Y
[in]XStepinterval between two vertical lines
[in]YStepinterval between two horizontal lines
[in]RotationAnglein-plane rotation angle, radians

◆ SetViewOff() [1/2]

void V3d_Viewer::SetViewOff ( )

Deactivates all the views of a Viewer attached to a window.

◆ SetViewOff() [2/2]

void V3d_Viewer::SetViewOff ( const occ::handle< V3d_View > & theView)

Deactivates a particular view in the Viewer. Must be call if the Window attached to the view has been Iconified .

◆ SetViewOn() [1/2]

void V3d_Viewer::SetViewOn ( )

Activates all of the views of a viewer attached to a window.

◆ SetViewOn() [2/2]

void V3d_Viewer::SetViewOn ( const occ::handle< V3d_View > & theView)

Activates a particular view in the Viewer. Must be call if the Window attached to the view has been Deiconified.

◆ SetZLayerSettings()

void V3d_Viewer::SetZLayerSettings ( const Graphic3d_ZLayerId theLayerId,
const Graphic3d_ZLayerSettings & theSettings )

Sets the settings for a single Z layer.

◆ ShowGridEcho()

void V3d_Viewer::ShowGridEcho ( const occ::handle< V3d_View > & theView,
const Graphic3d_Vertex & thePoint )

Displays the echo marker in a single view.

Parameters
[in]theViewview in which to draw the echo
[in]thePointworld-space snapped point

◆ StructureManager()

occ::handle< Graphic3d_StructureManager > V3d_Viewer::StructureManager ( ) const
inline

Returns the structure manager associated to this viewer.

◆ UnHighlight()

void V3d_Viewer::UnHighlight ( ) const

UnHighlight all Objects in All the views.

◆ Update()

void V3d_Viewer::Update ( )
inline

Deprecated, Redraw() should be used instead.

◆ UpdateLights()

void V3d_Viewer::UpdateLights ( )

Updates the lights of all the views of a viewer.

◆ ZLayerSettings()

const Graphic3d_ZLayerSettings & V3d_Viewer::ZLayerSettings ( const Graphic3d_ZLayerId theLayerId) const

Returns the settings of a single Z layer.


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