Open CASCADE Technology  6.9.1
Public Member Functions
Visual3d_View Class Reference

Creation and edition of a view in a 3D visualiser. A 3D view is composed of an "orientation" part defined by the position of the observer, the direction of view, and a "mapping" part defined by the type of projection (parallel or perspective) and by the window-viewport couple which allows passage from the projected coordinate space into the screen space. Summary of 3D Viewing To define a view, you must define: More...

#include <Visual3d_View.hxx>

Inheritance diagram for Visual3d_View:
Inheritance graph
[legend]

Public Member Functions

 Visual3d_View (const Handle< Visual3d_ViewManager > &AManager)
 Creates a view in the viewer <AManager> with a default orientation and a default mapping. More...
 
void Activate ()
 Activates the view <me>. Map the associated window on the screen and post the view in this window. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined. More...
 
void Deactivate ()
 Deactivates the view <me>. Unmap the associated window on the screen and unpost the view in this window. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined. More...
 
virtual void Destroy ()
 Deletes and erases the view <me>. More...
 
 ~Visual3d_View ()
 
void Redraw ()
 Updates screen in all cases. More...
 
void RedrawImmediate ()
 Updates layer of immediate presentations. More...
 
void Redraw (const Standard_Integer x, const Standard_Integer y, const Standard_Integer width, const Standard_Integer height)
 Updates screen area in all cases. area is given by his xy min corner and size in pixel coordinates. More...
 
void Redraw (const Handle< Visual3d_Layer > &AnUnderLayer, const Handle< Visual3d_Layer > &AnOverLayer)
 Updates screen in all cases. More...
 
void RedrawImmediate (const Handle< Visual3d_Layer > &theUnderLayer, const Handle< Visual3d_Layer > &theOverLayer)
 Updates layer of immediate presentations. More...
 
void Invalidate ()
 Invalidates view content but does not redraw it. More...
 
void Redraw (const Handle< Visual3d_Layer > &AnUnderLayer, const Handle< Visual3d_Layer > &AnOverLayer, const Standard_Integer x, const Standard_Integer y, const Standard_Integer width, const Standard_Integer height)
 Updates screen area in all cases. area is given by his xy min corner and size in pixel coordinates. More...
 
void Remove ()
 Deletes and erases the view <me>. Warning: No more graphic operations in <me> after this call. More...
 
void Resized ()
 Updates the view <me> after the modification of the associated window. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined. More...
 
void SetBackground (const Aspect_Background &ABack)
 Modifies the default window background. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined. More...
 
void SetBackgroundImage (const Standard_CString FileName, const Aspect_FillMethod FillStyle, const Standard_Boolean update)
 Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined. More...
 
void SetBgImageStyle (const Aspect_FillMethod FillStyle, const Standard_Boolean update)
 Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined. More...
 
void SetGradientBackground (const Aspect_GradientBackground &ABack, const Standard_Boolean update)
 Modifies the gradient window background. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined. More...
 
void SetBgGradientStyle (const Aspect_GradientFillMethod FillStyle, const Standard_Boolean update)
 Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined. More...
 
void SetBackFacingModel (const Visual3d_TypeOfBackfacingModel aModel)
 Manages display of the back faces. More...
 
Visual3d_TypeOfBackfacingModel BackFacingModel () const
 Returns current state of the back faces display. More...
 
void SetContext (const Visual3d_ContextView &CTX)
 Sets the context <CTX> in the view <me>. More...
 
void SetViewMappingDefault ()
 Saves the current mapping which will be the reference value for the reset of the mapping done by the ViewmappingReset method. More...
 
void SetViewOrientationDefault ()
 Saves the current orientation which will be the reference value for the reset of the orientation done by the ViewOrientationReset method. More...
 
void SetWindow (const Handle< Aspect_Window > &AWindow)
 Associates the window <AWindow> to the view <me>. No new association if the window is already defined. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if it is impossible to associate a view and a window. (association already done or another problem) Modifies the viewmapping of the associated view when it calls the SetRatio method. More...
 
void SetWindow (const Handle< Aspect_Window > &AWindow, const Aspect_RenderingContext AContext, const Aspect_GraphicCallbackProc &ADisplayCB, const Standard_Address AClientData)
 Associates the window <AWindow> and context <AContext> to the view <me>. If <AContext> is not NULL the graphic context is used directly to draw something in this view. Otherwise an internal context is created. If <ADisplayCB> is not NULL then a user display CB is call at the end of the OCC graphic traversal and just before the swap of buffers. The <aClientData> is pass to this call back. No new association if the window is already defined. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if it is impossible to associate a view and a window. (association already done or another problem) Modifies the viewmapping of the associated view when it calls the SetRatio method. More...
 
void Update (const Aspect_TypeOfUpdate theUpdateMode)
 Updates screen in function of modifications of the structures. More...
 
void Update (const Handle< Visual3d_Layer > &AnUnderLayer, const Handle< Visual3d_Layer > &AnOverLayer)
 Updates screen in function of modifications of the structures. More...
 
void SetAutoZFitMode (const Standard_Boolean theIsOn, const Standard_Real theScaleFactor=1.0)
 Sets the automatic z-fit mode and its parameters. The auto z-fit has extra parameters which can controlled from application level to ensure that the size of viewing volume will be sufficiently large to cover the depth of unmanaged objects, for example, transformation persistent ones. More...
 
Standard_Boolean AutoZFitMode () const
 returns TRUE if automatic z-fit mode is turned on. More...
 
Standard_Real AutoZFitScaleFactor () const
 returns scale factor parameter of automatic z-fit mode. More...
 
void AutoZFit ()
 If automatic z-range fitting is turned on, adjusts Z-min and Z-max projection volume planes with call to ZFitAll. More...
 
void ZFitAll (const Standard_Real theScaleFactor=1.0)
 Change Z-min and Z-max planes of projection volume to match the displayed objects. More...
 
void ViewMappingReset ()
 Sets the value of the mapping to be the same as the mapping saved by the SetViewMappingDefaut method. More...
 
void ViewOrientationReset ()
 Sets the value of the orientation to be the same as the orientation saved by the SetViewOrientationDefaut method. More...
 
void SetComputedMode (const Standard_Boolean aMode)
 Switches computed HLR mode in the view. More...
 
Standard_Boolean ComputedMode () const
 Returns the computed HLR mode state. More...
 
void ZBufferTriedronSetup (const Quantity_NameOfColor XColor=Quantity_NOC_RED, const Quantity_NameOfColor YColor=Quantity_NOC_GREEN, const Quantity_NameOfColor ZColor=Quantity_NOC_BLUE1, const Standard_Real SizeRatio=0.8, const Standard_Real AxisDiametr=0.05, const Standard_Integer NbFacettes=12)
 Customization of the ZBUFFER Triedron. Initializes Colors of X Y and axis Scale ratio defines decreasing of trihedron size when its position is out of a View. More...
 
void TriedronDisplay (const Aspect_TypeOfTriedronPosition APosition=Aspect_TOTP_CENTER, const Quantity_NameOfColor AColor=Quantity_NOC_WHITE, const Standard_Real AScale=0.02, const Standard_Boolean AsWireframe=Standard_True)
 Display of the Triedron. Initialize position, color and length of Triedron axes. The scale is a percent of the window width. If AsWireframe is FALSE triedron is shown in shaded mode AColor is not considered for ZBUFFER mode. More...
 
void TriedronErase ()
 Erases the Triedron. More...
 
void TriedronEcho (const Aspect_TypeOfTriedronEcho AType=Aspect_TOTE_NONE)
 Highlights the echo zone of the Triedron. More...
 
const Graphic3d_GraduatedTrihedronGetGraduatedTrihedron () const
 Returns data of a graduated trihedron. More...
 
void GraduatedTrihedronDisplay (const Graphic3d_GraduatedTrihedron &theTrigedronData)
 Displays a graduated trihedron. More...
 
void GraduatedTrihedronErase ()
 Erases a graduated trihedron from the view. More...
 
Aspect_Background Background () const
 Returns the value of the default window background. More...
 
Aspect_GradientBackground GradientBackground () const
 Returns the value of the window background. More...
 
Standard_Boolean ContainsFacet () const
 Returns Standard_True if one of the structures displayed in the view <me> contains Polygons, Triangles or Quadrangles. More...
 
Standard_Boolean ContainsFacet (const Graphic3d_MapOfStructure &ASet) const
 Returns Standard_True if one of the structures in the set <ASet> contains Polygons, Triangles or Quadrangles. More...
 
const Visual3d_ContextViewContext () const
 Returns the current context of the view <me>. More...
 
void DisplayedStructures (Graphic3d_MapOfStructure &SG) const
 Returns the set of structures displayed in the view <me>. More...
 
Standard_Boolean IsActive () const
 Returns the activity flag of the view <me>. More...
 
Standard_Boolean IsDefined () const
 Returns True if the window associated to the view <me> is defined. More...
 
Standard_Boolean IsDeleted () const
 Returns Standard_True is the view <me> is deleted. <me> is deleted after the call Remove (me). More...
 
Bnd_Box MinMaxValues (const Standard_Boolean theToIgnoreInfiniteFlag=Standard_False) const
 Returns the coordinates of the boundary box of all structures displayed in the view <me>. If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box also includes minimum and maximum limits of graphical elements forming parts of infinite structures. More...
 
Bnd_Box MinMaxValues (const Graphic3d_MapOfStructure &theSet, const Standard_Boolean theToIgnoreInfiniteFlag=Standard_False) const
 Returns the coordinates of the boundary box of all structures in the set <theSet>. If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box also includes minimum and maximum limits of graphical elements forming parts of infinite structures. More...
 
Standard_Integer NumberOfDisplayedStructures () const
 Returns number of displayed structures in the view <me>. More...
 
void Projects (const Standard_Real AX, const Standard_Real AY, const Standard_Real AZ, Standard_Real &APX, Standard_Real &APY, Standard_Real &APZ) const
 Returns the coordinates of the projection of the 3d coordinates <AX>, <AY>, <AZ>. More...
 
const Handle< Graphic3d_Camera > & DefaultCamera () const
 
const Handle< Graphic3d_Camera > & Camera () const
 
void SetCamera (const Handle< Graphic3d_Camera > &theCamera)
 Set camera object to provide orientation and projection matrices for graphic driver. More...
 
Handle< Aspect_WindowWindow () const
 Returns the window associated to the view <me>. Warning: Raises ViewDefinitionError if the associated window isn't defined. More...
 
Standard_Integer LightLimit () const
 Returns the MAX number of light associated to the view <me>. More...
 
Standard_Integer PlaneLimit () const
 Returns the MAX number of clipping planes associated to the view <me>. More...
 
Handle< Visual3d_ViewManagerViewManager () const
 Returns the view manager handle which manage this view. More...
 
void ReCompute (const Handle< Graphic3d_Structure > &AStructure)
 Computes the new presentation of the structure <AStructure> displayed in <me> with the type Graphic3d_TOS_COMPUTED. More...
 
Standard_Boolean DisplayImmediate (const Handle< Graphic3d_Structure > &theStructure, const Standard_Boolean theIsSingleView=Standard_True)
 Add structure to the list of immediate presentations. More...
 
Standard_Boolean EraseImmediate (const Handle< Graphic3d_Structure > &theStructure)
 Removes the structure from the list of immediate presentations. More...
 
Standard_Boolean ClearImmediate ()
 Clears list of immediate presentations. More...
 
Standard_Integer Identification () const
 Returns the identification number of the view <me>. More...
 
Standard_Address CView () const
 Returns the c structure associated to <me>. More...
 
const Handle< Graphic3d_GraphicDriver > & GraphicDriver () const
 Returns the associated GraphicDriver. More...
 
Standard_Boolean Print (const Handle< Visual3d_Layer > &AnUnderLayer, const Handle< Visual3d_Layer > &AnOverLayer, const Aspect_Handle hPrnDC, const Standard_Boolean showBackground, const Standard_CString filename, const Aspect_PrintAlgo printAlgorithm=Aspect_PA_STRETCH, const Standard_Real theScaleFactor=1.0) const
 print the contents of all layers of the view to the printer. <hPrnDC> : Pass the PrinterDeviceContext (HDC), <showBackground> : When set to FALSE then print the view without background color (background is white) else set to TRUE for printing with current background color. <filename>: If != NULL, then the view will be printed to a file. <printAlgo>: Select print algorithm: stretch, tile. <theScaleFactor>: Scaling coefficient, used internally to scale the printings accordingly to the scale factor selected in the printer properties dialog. Returns Standard_True if the data is passed to the printer, otherwise Standard_False if the print operation failed due to printer error or insufficient memory. Warning: Works only under Windows. More...
 
Standard_Boolean Print (const Aspect_Handle hPrnDC, const Standard_Boolean showBackground, const Standard_CString filename, const Aspect_PrintAlgo printAlgorithm=Aspect_PA_STRETCH, const Standard_Real theScaleFactor=1.0) const
 print the contents of the view to printer. <hPrnDC> : Pass the PrinterDeviceContext (HDC), <showBackground> : When set to FALSE then print the view without background color (background is white) else set to TRUE for printing with current background color. <filename>: If != NULL, then the view will be printed to a file. <printAlgo>: Select print algorithm: stretch, tile. <theScaleFactor>: Scaling coefficient, used internally to scale the printings accordingly to the scale factor selected in the printer properties dialog. Returns Standard_True if the data is passed to the printer, otherwise Standard_False if the print operation failed due to printer error or insufficient memory. Warning: Works only under Windows. More...
 
Standard_Boolean ZBufferIsActivated () const
 Returns Standard_True if the ZBuffer is activated in the view <me> and Standard_False if not. More...
 
void SetZBufferActivity (const Standard_Integer AnActivity)
 Activates the ZBuffer if the integer <AnActivity> is equal to 1. Deactivates the ZBuffer if the integer <AnActivity> is equal to 0. If the integer <AnActivity> is equal to -1 then. More...
 
const Handle< Visual3d_Layer > & UnderLayer () const
 Returns the underlay of the view <me>. More...
 
const Handle< Visual3d_Layer > & OverLayer () const
 Returns the underlay of the view <me>. More...
 
void EnableDepthTest (const Standard_Boolean enable) const
 turns on/off opengl depth More...
 
Standard_Boolean IsDepthTestEnabled () const
 returns current state of the opengl depth testing More...
 
void ReadDepths (const Standard_Integer x, const Standard_Integer y, const Standard_Integer width, const Standard_Integer height, const Standard_Address buffer) const
 Reads depths of shown pixels of the given rectangle. More...
 
Graphic3d_PtrFrameBuffer FBOCreate (const Standard_Integer width, const Standard_Integer height)
 Generate offscreen FBO in the graphic library. More...
 
void FBORelease (Graphic3d_PtrFrameBuffer &fboPtr)
 Remove offscreen FBO from the graphic library. More...
 
void FBOGetDimensions (const Graphic3d_PtrFrameBuffer fboPtr, Standard_Integer &width, Standard_Integer &height, Standard_Integer &widthMax, Standard_Integer &heightMax)
 Read offscreen FBO configuration. More...
 
void FBOChangeViewport (Graphic3d_PtrFrameBuffer &fboPtr, const Standard_Integer width, const Standard_Integer height)
 Change offscreen FBO viewport. More...
 
Standard_Boolean BufferDump (Image_PixMap &theImage, const Graphic3d_BufferType &theBufferType)
 Dump active rendering buffer into specified memory buffer. More...
 
void EnableGLLight (const Standard_Boolean enable) const
 turns on/off opengl lighting, currently used in triedron displaying More...
 
Standard_Boolean IsGLLightEnabled () const
 returns the current state of the gl lighting currently used in triedron displaying More...
 
Standard_Boolean Export (const Standard_CString theFileName, const Graphic3d_ExportFormat theFormat, const Graphic3d_SortType theSortType=Graphic3d_ST_BSP_Tree, const Standard_Real thePrecision=0.005, const Standard_Address theProgressBarFunc=NULL, const Standard_Address theProgressObject=NULL) const
 Export scene into the one of the Vector graphics formats (SVG, PS, PDF...). In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer). Notice however that results may differ a lot and do not contain some elements. More...
 
const Handle< Graphic3d_NMapOfTransient > & HiddenObjects () const
 Returns map of objects hidden within this specific view (not viewer-wise). More...
 
Handle< Graphic3d_NMapOfTransient > & ChangeHiddenObjects ()
 Returns map of objects hidden within this specific view (not viewer-wise). More...
 
- Public Member Functions inherited from Graphic3d_DataStructureManager
 ~Graphic3d_DataStructureManager ()
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual const Handle_Standard_Type & DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const 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. More...
 
Standard_Boolean IsKind (const Standard_CString 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. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Graphic3d_DataStructureManager
 Graphic3d_DataStructureManager ()
 Initializes the manager <me>. More...
 

Detailed Description

Creation and edition of a view in a 3D visualiser. A 3D view is composed of an "orientation" part defined by the position of the observer, the direction of view, and a "mapping" part defined by the type of projection (parallel or perspective) and by the window-viewport couple which allows passage from the projected coordinate space into the screen space. Summary of 3D Viewing To define a view, you must define:

Constructor & Destructor Documentation

Visual3d_View::Visual3d_View ( const Handle< Visual3d_ViewManager > &  AManager)

Creates a view in the viewer <AManager> with a default orientation and a default mapping.

Visual3d_View::~Visual3d_View ( )
inline

Member Function Documentation

void Visual3d_View::Activate ( )

Activates the view <me>. Map the associated window on the screen and post the view in this window. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined.

void Visual3d_View::AutoZFit ( )

If automatic z-range fitting is turned on, adjusts Z-min and Z-max projection volume planes with call to ZFitAll.

Standard_Boolean Visual3d_View::AutoZFitMode ( ) const

returns TRUE if automatic z-fit mode is turned on.

Standard_Real Visual3d_View::AutoZFitScaleFactor ( ) const

returns scale factor parameter of automatic z-fit mode.

Visual3d_TypeOfBackfacingModel Visual3d_View::BackFacingModel ( ) const

Returns current state of the back faces display.

Aspect_Background Visual3d_View::Background ( ) const

Returns the value of the default window background.

Standard_Boolean Visual3d_View::BufferDump ( Image_PixMap theImage,
const Graphic3d_BufferType theBufferType 
)

Dump active rendering buffer into specified memory buffer.

const Handle< Graphic3d_Camera >& Visual3d_View::Camera ( ) const
Returns
the camera of <me>.
Handle< Graphic3d_NMapOfTransient >& Visual3d_View::ChangeHiddenObjects ( )

Returns map of objects hidden within this specific view (not viewer-wise).

Standard_Boolean Visual3d_View::ClearImmediate ( )

Clears list of immediate presentations.

Returns
true if list was not empty
Standard_Boolean Visual3d_View::ComputedMode ( ) const

Returns the computed HLR mode state.

Standard_Boolean Visual3d_View::ContainsFacet ( ) const

Returns Standard_True if one of the structures displayed in the view <me> contains Polygons, Triangles or Quadrangles.

Standard_Boolean Visual3d_View::ContainsFacet ( const Graphic3d_MapOfStructure ASet) const

Returns Standard_True if one of the structures in the set <ASet> contains Polygons, Triangles or Quadrangles.

const Visual3d_ContextView& Visual3d_View::Context ( ) const

Returns the current context of the view <me>.

Standard_Address Visual3d_View::CView ( ) const

Returns the c structure associated to <me>.

void Visual3d_View::Deactivate ( )

Deactivates the view <me>. Unmap the associated window on the screen and unpost the view in this window. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined.

const Handle< Graphic3d_Camera >& Visual3d_View::DefaultCamera ( ) const
Returns
the default camera of <me>.
virtual void Visual3d_View::Destroy ( )
virtual

Deletes and erases the view <me>.

Reimplemented from Graphic3d_DataStructureManager.

void Visual3d_View::DisplayedStructures ( Graphic3d_MapOfStructure SG) const

Returns the set of structures displayed in the view <me>.

Standard_Boolean Visual3d_View::DisplayImmediate ( const Handle< Graphic3d_Structure > &  theStructure,
const Standard_Boolean  theIsSingleView = Standard_True 
)

Add structure to the list of immediate presentations.

Returns
true if structure has not been registered in this view
void Visual3d_View::EnableDepthTest ( const Standard_Boolean  enable) const

turns on/off opengl depth

void Visual3d_View::EnableGLLight ( const Standard_Boolean  enable) const

turns on/off opengl lighting, currently used in triedron displaying

Standard_Boolean Visual3d_View::EraseImmediate ( const Handle< Graphic3d_Structure > &  theStructure)

Removes the structure from the list of immediate presentations.

Returns
true if structure has been registered in view
Standard_Boolean Visual3d_View::Export ( const Standard_CString  theFileName,
const Graphic3d_ExportFormat  theFormat,
const Graphic3d_SortType  theSortType = Graphic3d_ST_BSP_Tree,
const Standard_Real  thePrecision = 0.005,
const Standard_Address  theProgressBarFunc = NULL,
const Standard_Address  theProgressObject = NULL 
) const

Export scene into the one of the Vector graphics formats (SVG, PS, PDF...). In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer). Notice however that results may differ a lot and do not contain some elements.

void Visual3d_View::FBOChangeViewport ( Graphic3d_PtrFrameBuffer fboPtr,
const Standard_Integer  width,
const Standard_Integer  height 
)

Change offscreen FBO viewport.

Graphic3d_PtrFrameBuffer Visual3d_View::FBOCreate ( const Standard_Integer  width,
const Standard_Integer  height 
)

Generate offscreen FBO in the graphic library.

void Visual3d_View::FBOGetDimensions ( const Graphic3d_PtrFrameBuffer  fboPtr,
Standard_Integer width,
Standard_Integer height,
Standard_Integer widthMax,
Standard_Integer heightMax 
)

Read offscreen FBO configuration.

void Visual3d_View::FBORelease ( Graphic3d_PtrFrameBuffer fboPtr)

Remove offscreen FBO from the graphic library.

const Graphic3d_GraduatedTrihedron& Visual3d_View::GetGraduatedTrihedron ( ) const

Returns data of a graduated trihedron.

Aspect_GradientBackground Visual3d_View::GradientBackground ( ) const

Returns the value of the window background.

void Visual3d_View::GraduatedTrihedronDisplay ( const Graphic3d_GraduatedTrihedron theTrigedronData)

Displays a graduated trihedron.

void Visual3d_View::GraduatedTrihedronErase ( )

Erases a graduated trihedron from the view.

const Handle< Graphic3d_GraphicDriver >& Visual3d_View::GraphicDriver ( ) const

Returns the associated GraphicDriver.

const Handle< Graphic3d_NMapOfTransient >& Visual3d_View::HiddenObjects ( ) const

Returns map of objects hidden within this specific view (not viewer-wise).

Standard_Integer Visual3d_View::Identification ( ) const

Returns the identification number of the view <me>.

void Visual3d_View::Invalidate ( )

Invalidates view content but does not redraw it.

Standard_Boolean Visual3d_View::IsActive ( ) const

Returns the activity flag of the view <me>.

Standard_Boolean Visual3d_View::IsDefined ( ) const

Returns True if the window associated to the view <me> is defined.

Standard_Boolean Visual3d_View::IsDeleted ( ) const

Returns Standard_True is the view <me> is deleted. <me> is deleted after the call Remove (me).

Standard_Boolean Visual3d_View::IsDepthTestEnabled ( ) const

returns current state of the opengl depth testing

Standard_Boolean Visual3d_View::IsGLLightEnabled ( ) const

returns the current state of the gl lighting currently used in triedron displaying

Standard_Integer Visual3d_View::LightLimit ( ) const

Returns the MAX number of light associated to the view <me>.

Bnd_Box Visual3d_View::MinMaxValues ( const Standard_Boolean  theToIgnoreInfiniteFlag = Standard_False) const

Returns the coordinates of the boundary box of all structures displayed in the view <me>. If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box also includes minimum and maximum limits of graphical elements forming parts of infinite structures.

Bnd_Box Visual3d_View::MinMaxValues ( const Graphic3d_MapOfStructure theSet,
const Standard_Boolean  theToIgnoreInfiniteFlag = Standard_False 
) const

Returns the coordinates of the boundary box of all structures in the set <theSet>. If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box also includes minimum and maximum limits of graphical elements forming parts of infinite structures.

Standard_Integer Visual3d_View::NumberOfDisplayedStructures ( ) const

Returns number of displayed structures in the view <me>.

const Handle< Visual3d_Layer >& Visual3d_View::OverLayer ( ) const

Returns the underlay of the view <me>.

Standard_Integer Visual3d_View::PlaneLimit ( ) const

Returns the MAX number of clipping planes associated to the view <me>.

Standard_Boolean Visual3d_View::Print ( const Handle< Visual3d_Layer > &  AnUnderLayer,
const Handle< Visual3d_Layer > &  AnOverLayer,
const Aspect_Handle  hPrnDC,
const Standard_Boolean  showBackground,
const Standard_CString  filename,
const Aspect_PrintAlgo  printAlgorithm = Aspect_PA_STRETCH,
const Standard_Real  theScaleFactor = 1.0 
) const

print the contents of all layers of the view to the printer. <hPrnDC> : Pass the PrinterDeviceContext (HDC), <showBackground> : When set to FALSE then print the view without background color (background is white) else set to TRUE for printing with current background color. <filename>: If != NULL, then the view will be printed to a file. <printAlgo>: Select print algorithm: stretch, tile. <theScaleFactor>: Scaling coefficient, used internally to scale the printings accordingly to the scale factor selected in the printer properties dialog. Returns Standard_True if the data is passed to the printer, otherwise Standard_False if the print operation failed due to printer error or insufficient memory. Warning: Works only under Windows.

Standard_Boolean Visual3d_View::Print ( const Aspect_Handle  hPrnDC,
const Standard_Boolean  showBackground,
const Standard_CString  filename,
const Aspect_PrintAlgo  printAlgorithm = Aspect_PA_STRETCH,
const Standard_Real  theScaleFactor = 1.0 
) const

print the contents of the view to printer. <hPrnDC> : Pass the PrinterDeviceContext (HDC), <showBackground> : When set to FALSE then print the view without background color (background is white) else set to TRUE for printing with current background color. <filename>: If != NULL, then the view will be printed to a file. <printAlgo>: Select print algorithm: stretch, tile. <theScaleFactor>: Scaling coefficient, used internally to scale the printings accordingly to the scale factor selected in the printer properties dialog. Returns Standard_True if the data is passed to the printer, otherwise Standard_False if the print operation failed due to printer error or insufficient memory. Warning: Works only under Windows.

void Visual3d_View::Projects ( const Standard_Real  AX,
const Standard_Real  AY,
const Standard_Real  AZ,
Standard_Real APX,
Standard_Real APY,
Standard_Real APZ 
) const

Returns the coordinates of the projection of the 3d coordinates <AX>, <AY>, <AZ>.

void Visual3d_View::ReadDepths ( const Standard_Integer  x,
const Standard_Integer  y,
const Standard_Integer  width,
const Standard_Integer  height,
const Standard_Address  buffer 
) const

Reads depths of shown pixels of the given rectangle.

void Visual3d_View::ReCompute ( const Handle< Graphic3d_Structure > &  AStructure)

Computes the new presentation of the structure <AStructure> displayed in <me> with the type Graphic3d_TOS_COMPUTED.

void Visual3d_View::Redraw ( )

Updates screen in all cases.

void Visual3d_View::Redraw ( const Standard_Integer  x,
const Standard_Integer  y,
const Standard_Integer  width,
const Standard_Integer  height 
)

Updates screen area in all cases. area is given by his xy min corner and size in pixel coordinates.

void Visual3d_View::Redraw ( const Handle< Visual3d_Layer > &  AnUnderLayer,
const Handle< Visual3d_Layer > &  AnOverLayer 
)

Updates screen in all cases.

void Visual3d_View::Redraw ( const Handle< Visual3d_Layer > &  AnUnderLayer,
const Handle< Visual3d_Layer > &  AnOverLayer,
const Standard_Integer  x,
const Standard_Integer  y,
const Standard_Integer  width,
const Standard_Integer  height 
)

Updates screen area in all cases. area is given by his xy min corner and size in pixel coordinates.

void Visual3d_View::RedrawImmediate ( )

Updates layer of immediate presentations.

void Visual3d_View::RedrawImmediate ( const Handle< Visual3d_Layer > &  theUnderLayer,
const Handle< Visual3d_Layer > &  theOverLayer 
)

Updates layer of immediate presentations.

void Visual3d_View::Remove ( )

Deletes and erases the view <me>. Warning: No more graphic operations in <me> after this call.

void Visual3d_View::Resized ( )

Updates the view <me> after the modification of the associated window. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined.

void Visual3d_View::SetAutoZFitMode ( const Standard_Boolean  theIsOn,
const Standard_Real  theScaleFactor = 1.0 
)

Sets the automatic z-fit mode and its parameters. The auto z-fit has extra parameters which can controlled from application level to ensure that the size of viewing volume will be sufficiently large to cover the depth of unmanaged objects, for example, transformation persistent ones.

Parameters
theScaleFactor[in] the scale factor for Z-range. The range between Z-min, Z-max projection volume planes evaluated by z fitting method will be scaled using this coefficient. Program error exception is thrown if negative or zero value is passed.
void Visual3d_View::SetBackFacingModel ( const Visual3d_TypeOfBackfacingModel  aModel)

Manages display of the back faces.

void Visual3d_View::SetBackground ( const Aspect_Background ABack)

Modifies the default window background. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined.

void Visual3d_View::SetBackgroundImage ( const Standard_CString  FileName,
const Aspect_FillMethod  FillStyle,
const Standard_Boolean  update 
)

Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined.

void Visual3d_View::SetBgGradientStyle ( const Aspect_GradientFillMethod  FillStyle,
const Standard_Boolean  update 
)

Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined.

void Visual3d_View::SetBgImageStyle ( const Aspect_FillMethod  FillStyle,
const Standard_Boolean  update 
)

Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined.

void Visual3d_View::SetCamera ( const Handle< Graphic3d_Camera > &  theCamera)

Set camera object to provide orientation and projection matrices for graphic driver.

void Visual3d_View::SetComputedMode ( const Standard_Boolean  aMode)

Switches computed HLR mode in the view.

void Visual3d_View::SetContext ( const Visual3d_ContextView CTX)

Sets the context <CTX> in the view <me>.

void Visual3d_View::SetGradientBackground ( const Aspect_GradientBackground ABack,
const Standard_Boolean  update 
)

Modifies the gradient window background. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if the associated window isn't defined.

void Visual3d_View::SetViewMappingDefault ( )

Saves the current mapping which will be the reference value for the reset of the mapping done by the ViewmappingReset method.

void Visual3d_View::SetViewOrientationDefault ( )

Saves the current orientation which will be the reference value for the reset of the orientation done by the ViewOrientationReset method.

void Visual3d_View::SetWindow ( const Handle< Aspect_Window > &  AWindow)

Associates the window <AWindow> to the view <me>. No new association if the window is already defined. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if it is impossible to associate a view and a window. (association already done or another problem) Modifies the viewmapping of the associated view when it calls the SetRatio method.

After this call, each view is mapped in an unique window.

Programming example :

An example when we have 1 view and 1 window

Handle(Aspect_DisplayConnection) aDisplayConnection;

// Display connection initialization only needed on Linux platform // and on Mac OS X, in cases when you use Xlib for windows drawing. aDisplayConnection = new Aspect_DisplayConnection();

// Graphic driver initialization Handle(Graphic3d_GraphicDriver) aGraphicDriver = Graphic3d::InitGraphicDriver (aDisplayConnection);

// Define a view manager Handle(Visual3d_ViewManager) aVisualManager = new Visual3d_ViewManager (aGraphicDriver);

// Define a view Handle(Visual3d_View) aView = new Visual3d_View (aVisaulManager);

// Define a window Handle(Xw_Window) aWindow = new Xw_Window (aDisplayConnection, "Graphic View 1", 0.695, 0.695, 0.600, 0.600, Quantity_NOC_MATRAGRAY);

// Associate the view and the window aView->SetWindow (aWindow);

// Map the window aWindow->Map ();

// Activate the view aView->Activate ();

void Visual3d_View::SetWindow ( const Handle< Aspect_Window > &  AWindow,
const Aspect_RenderingContext  AContext,
const Aspect_GraphicCallbackProc ADisplayCB,
const Standard_Address  AClientData 
)

Associates the window <AWindow> and context <AContext> to the view <me>. If <AContext> is not NULL the graphic context is used directly to draw something in this view. Otherwise an internal context is created. If <ADisplayCB> is not NULL then a user display CB is call at the end of the OCC graphic traversal and just before the swap of buffers. The <aClientData> is pass to this call back. No new association if the window is already defined. Category: Methods to modify the class definition Warning: Raises ViewDefinitionError if it is impossible to associate a view and a window. (association already done or another problem) Modifies the viewmapping of the associated view when it calls the SetRatio method.

After this call, each view is mapped in an unique window.

void Visual3d_View::SetZBufferActivity ( const Standard_Integer  AnActivity)

Activates the ZBuffer if the integer <AnActivity> is equal to 1. Deactivates the ZBuffer if the integer <AnActivity> is equal to 0. If the integer <AnActivity> is equal to -1 then.

  • the ZBuffer is activated if me->Context ().Visualization () == Visual3d_TOV_SHADING
  • the ZBuffer is deactivated if me->Context ().Visualization () == Visual3d_TOV_WIREFRAME
void Visual3d_View::TriedronDisplay ( const Aspect_TypeOfTriedronPosition  APosition = Aspect_TOTP_CENTER,
const Quantity_NameOfColor  AColor = Quantity_NOC_WHITE,
const Standard_Real  AScale = 0.02,
const Standard_Boolean  AsWireframe = Standard_True 
)

Display of the Triedron. Initialize position, color and length of Triedron axes. The scale is a percent of the window width. If AsWireframe is FALSE triedron is shown in shaded mode AColor is not considered for ZBUFFER mode.

void Visual3d_View::TriedronEcho ( const Aspect_TypeOfTriedronEcho  AType = Aspect_TOTE_NONE)

Highlights the echo zone of the Triedron.

void Visual3d_View::TriedronErase ( )

Erases the Triedron.

const Handle< Visual3d_Layer >& Visual3d_View::UnderLayer ( ) const

Returns the underlay of the view <me>.

void Visual3d_View::Update ( const Aspect_TypeOfUpdate  theUpdateMode)

Updates screen in function of modifications of the structures.

void Visual3d_View::Update ( const Handle< Visual3d_Layer > &  AnUnderLayer,
const Handle< Visual3d_Layer > &  AnOverLayer 
)

Updates screen in function of modifications of the structures.

Handle< Visual3d_ViewManager > Visual3d_View::ViewManager ( ) const

Returns the view manager handle which manage this view.

void Visual3d_View::ViewMappingReset ( )

Sets the value of the mapping to be the same as the mapping saved by the SetViewMappingDefaut method.

void Visual3d_View::ViewOrientationReset ( )

Sets the value of the orientation to be the same as the orientation saved by the SetViewOrientationDefaut method.

Handle< Aspect_Window > Visual3d_View::Window ( ) const

Returns the window associated to the view <me>. Warning: Raises ViewDefinitionError if the associated window isn't defined.

Standard_Boolean Visual3d_View::ZBufferIsActivated ( ) const

Returns Standard_True if the ZBuffer is activated in the view <me> and Standard_False if not.

void Visual3d_View::ZBufferTriedronSetup ( const Quantity_NameOfColor  XColor = Quantity_NOC_RED,
const Quantity_NameOfColor  YColor = Quantity_NOC_GREEN,
const Quantity_NameOfColor  ZColor = Quantity_NOC_BLUE1,
const Standard_Real  SizeRatio = 0.8,
const Standard_Real  AxisDiametr = 0.05,
const Standard_Integer  NbFacettes = 12 
)

Customization of the ZBUFFER Triedron. Initializes Colors of X Y and axis Scale ratio defines decreasing of trihedron size when its position is out of a View.

void Visual3d_View::ZFitAll ( const Standard_Real  theScaleFactor = 1.0)

Change Z-min and Z-max planes of projection volume to match the displayed objects.


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