Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
ViewerTest_V3dView Class Reference

Setting additional flag to store 2D mode of the View to avoid scene rotation by mouse/key events. More...

#include <ViewerTest_V3dView.hxx>

Inheritance diagram for ViewerTest_V3dView:
Inheritance graph
[legend]

Public Member Functions

 ViewerTest_V3dView (const occ::handle< V3d_Viewer > &theViewer, const V3d_TypeOfView theType=V3d_ORTHOGRAPHIC, bool theIs2dMode=false)
 Initializes the view.
 
 ViewerTest_V3dView (const occ::handle< V3d_Viewer > &theViewer, const occ::handle< V3d_View > &theView)
 Initializes the view by copying.
 
bool IsViewIn2DMode () const
 Returns true if 2D mode is set for the view.
 
void SetView2DMode (bool the2dMode)
 Sets 2D mode for the view.
 
- Public Member Functions inherited from V3d_View
 V3d_View (const occ::handle< V3d_Viewer > &theViewer, const V3d_TypeOfView theType=V3d_ORTHOGRAPHIC)
 Initializes the view.
 
 V3d_View (const occ::handle< V3d_Viewer > &theViewer, const occ::handle< V3d_View > &theView)
 Initializes the view by copying.
 
 ~V3d_View () override
 Default destructor.
 
void SetWindow (const occ::handle< Aspect_Window > &theWindow, const Aspect_RenderingContext theContext=nullptr)
 Activates the view in the specified Window If <aContext> is not NULL the graphic context is used to draw something in this view. Otherwise an internal graphic context is created. Warning: The view is centered and resized to preserve the height/width ratio of the window.
 
void SetWindow (const occ::handle< V3d_View > &theParentView, const NCollection_Vec2< double > &theSize, Aspect_TypeOfTriedronPosition theCorner=Aspect_TOTP_LEFT_UPPER, const NCollection_Vec2< double > &theOffset=NCollection_Vec2< double >(), const NCollection_Vec2< int > &theMargins=NCollection_Vec2< int >())
 Activates the view as subview of another view.
 
void SetMagnify (const occ::handle< Aspect_Window > &theWindow, const occ::handle< V3d_View > &thePreviousView, const int theX1, const int theY1, const int theX2, const int theY2)
 
void Remove ()
 Destroys the view.
 
void Update () const
 Deprecated, Redraw() should be used instead.
 
virtual void Redraw () const
 Redisplays the view even if there has not been any modification. Must be called if the view is shown. (Ex: DeIconification ) .
 
virtual void RedrawImmediate () const
 Updates layer of immediate presentations.
 
void Invalidate () const
 Invalidates view content but does not redraw it.
 
bool IsInvalidated () const
 Returns true if cached view content has been invalidated.
 
bool IsInvalidatedImmediate () const
 Returns true if immediate layer content has been invalidated.
 
void InvalidateImmediate ()
 Invalidates view content within immediate layer but does not redraw it.
 
void MustBeResized ()
 Must be called when the window supporting the view changes size. if the view is not mapped on a window. Warning: The view is centered and resized to preserve the height/width ratio of the window.
 
void DoMapping ()
 Must be called when the window supporting the view is mapped or unmapped.
 
bool IsEmpty () const
 Returns the status of the view regarding the displayed structures inside Returns True is The View is empty.
 
void UpdateLights () const
 Updates the lights of the view.
 
void SetAutoZFitMode (const bool theIsOn, const double 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.
 
bool AutoZFitMode () const
 returns TRUE if automatic z-fit mode is turned on.
 
double AutoZFitScaleFactor () const
 returns scale factor parameter of automatic z-fit mode.
 
void AutoZFit () const
 If automatic z-range fitting is turned on, adjusts Z-min and Z-max projection volume planes with call to ZFitAll.
 
void ZFitAll (const double theScaleFactor=1.0) const
 Change Z-min and Z-max planes of projection volume to match the displayed objects.
 
void SetBackgroundColor (const Quantity_TypeOfColor theType, const double theV1, const double theV2, const double theV3)
 Defines the background color of the view by the color definition type and the three corresponding values.
 
void SetBackgroundColor (const Quantity_Color &theColor)
 Defines the background color of the view.
 
void SetBgGradientColors (const Quantity_Color &theColor1, const Quantity_Color &theColor2, const Aspect_GradientFillMethod theFillStyle=Aspect_GradientFillMethod_Horizontal, const bool theToUpdate=false)
 Defines the gradient background colors of the view by supplying the colors and the fill method (horizontal by default).
 
void SetBgGradientStyle (const Aspect_GradientFillMethod theMethod=Aspect_GradientFillMethod_Horizontal, const bool theToUpdate=false)
 Defines the gradient background fill method of the view.
 
void SetBackgroundImage (const char *const theFileName, const Aspect_FillMethod theFillStyle=Aspect_FM_CENTERED, const bool theToUpdate=false)
 Defines the background texture of the view by supplying the texture image file name and fill method (centered by default).
 
void SetBackgroundImage (const occ::handle< Graphic3d_Texture2D > &theTexture, const Aspect_FillMethod theFillStyle=Aspect_FM_CENTERED, const bool theToUpdate=false)
 Defines the background texture of the view by supplying the texture and fill method (centered by default)
 
void SetBgImageStyle (const Aspect_FillMethod theFillStyle, const bool theToUpdate=false)
 Defines the textured background fill method of the view.
 
void SetBackgroundCubeMap (const occ::handle< Graphic3d_CubeMap > &theCubeMap, bool theToUpdatePBREnv=true, bool theToUpdate=false)
 Sets environment cubemap as background.
 
const Aspect_SkydomeBackgroundBackgroundSkydome () const
 Returns skydome aspect;.
 
void SetBackgroundSkydome (const Aspect_SkydomeBackground &theAspect, bool theToUpdatePBREnv=true)
 Sets skydome aspect.
 
bool IsImageBasedLighting () const
 Returns TRUE if IBL (Image Based Lighting) from background cubemap is enabled.
 
void SetImageBasedLighting (bool theToEnableIBL, bool theToUpdate=false)
 Enables or disables IBL (Image Based Lighting) from background cubemap. Has no effect if PBR is not used.
 
void GeneratePBREnvironment (bool theToUpdate=false)
 Activates IBL from background cubemap.
 
void ClearPBREnvironment (bool theToUpdate=false)
 Disables IBL from background cubemap; fills PBR specular probe and irradiance map with white color.
 
void SetTextureEnv (const occ::handle< Graphic3d_TextureEnv > &theTexture)
 Sets the environment texture to use. No environment texture by default.
 
void SetAxis (const double X, const double Y, const double Z, const double Vx, const double Vy, const double Vz)
 Definition of an axis from its origin and its orientation . This will be the current axis for rotations and movements. Warning! raises BadValue from V3d if the vector normal is NULL. .
 
void SetVisualization (const V3d_TypeOfVisualization theType)
 Defines the visualization type in the view.
 
void SetLightOn (const occ::handle< V3d_Light > &theLight)
 Activates theLight in the view.
 
void SetLightOn ()
 Activates all the lights defined in this view.
 
void SetLightOff (const occ::handle< V3d_Light > &theLight)
 Deactivate theLight in this view.
 
void SetLightOff ()
 Deactivate all the Lights defined in this view.
 
bool IsActiveLight (const occ::handle< V3d_Light > &theLight) const
 Returns TRUE when the light is active in this view.
 
bool SetImmediateUpdate (const bool theImmediateUpdate)
 sets the immediate update mode and returns the previous one.
 
const occ::handle< V3d_Trihedron > & Trihedron (bool theToCreate=true)
 Returns trihedron object.
 
void ZBufferTriedronSetup (const Quantity_Color &theXColor=Quantity_NOC_RED, const Quantity_Color &theYColor=Quantity_NOC_GREEN, const Quantity_Color &theZColor=Quantity_NOC_BLUE1, const double theSizeRatio=0.8, const double theAxisDiametr=0.05, const int theNbFacettes=12)
 Customization of the ZBUFFER Triedron. XColor,YColor,ZColor - colors of axis SizeRatio - ratio of decreasing of the trihedron size when its physical position comes out of the view AxisDiametr - diameter relatively to axis length NbFacettes - number of facets of cylinders and cones.
 
void TriedronDisplay (const Aspect_TypeOfTriedronPosition thePosition=Aspect_TOTP_CENTER, const Quantity_Color &theColor=Quantity_NOC_WHITE, const double theScale=0.02, const V3d_TypeOfVisualization theMode=V3d_WIREFRAME)
 Display of the Triedron. Initialize position, color and length of Triedron axes. The scale is a percent of the window width.
 
void TriedronErase ()
 Erases the Triedron.
 
const Graphic3d_GraduatedTrihedronGetGraduatedTrihedron () const
 Returns data of a graduated trihedron.
 
void GraduatedTrihedronDisplay (const Graphic3d_GraduatedTrihedron &theTrihedronData)
 Displays a graduated trihedron.
 
void GraduatedTrihedronErase ()
 Erases a graduated trihedron from the view.
 
void SetFront ()
 modify the Projection of the view perpendicularly to the privileged plane of the viewer.
 
void Rotate (const double Ax, const double Ay, const double Az, const bool Start=true)
 Rotates the eye about the coordinate system of reference of the screen for which the origin is the view point of the projection, with a relative angular value in RADIANS with respect to the initial position expressed by Start = true Warning! raises BadValue from V3d If the eye, the view point, or the high point are aligned or confused.
 
void Rotate (const double Ax, const double Ay, const double Az, const double X, const double Y, const double Z, const bool Start=true)
 Rotates the eye about the coordinate system of reference of the screen for which the origin is Gravity point {X,Y,Z}, with a relative angular value in RADIANS with respect to the initial position expressed by Start = true If the eye, the view point, or the high point are aligned or confused.
 
void Rotate (const V3d_TypeOfAxe Axe, const double Angle, const double X, const double Y, const double Z, const bool Start=true)
 Rotates the eye about one of the coordinate axes of of the view for which the origin is the Gravity point{X,Y,Z} with an relative angular value in RADIANS with respect to the initial position expressed by Start = true.
 
void Rotate (const V3d_TypeOfAxe Axe, const double Angle, const bool Start=true)
 Rotates the eye about one of the coordinate axes of of the view for which the origin is the view point of the projection with an relative angular value in RADIANS with respect to the initial position expressed by Start = true.
 
void Rotate (const double Angle, const bool Start=true)
 Rotates the eye around the current axis a relative angular value in RADIANS with respect to the initial position expressed by Start = true.
 
void Move (const double Dx, const double Dy, const double Dz, const bool Start=true)
 Movement of the eye parallel to the coordinate system of reference of the screen a distance relative to the initial position expressed by Start = true.
 
void Move (const V3d_TypeOfAxe Axe, const double Length, const bool Start=true)
 Movement of the eye parallel to one of the axes of the coordinate system of reference of the view a distance relative to the initial position expressed by Start = true.
 
void Move (const double Length, const bool Start=true)
 Movement of the eye parllel to the current axis a distance relative to the initial position expressed by Start = true.
 
void Translate (const double Dx, const double Dy, const double Dz, const bool Start=true)
 Movement of the ye and the view point parallel to the frame of reference of the screen a distance relative to the initial position expressed by Start = true.
 
void Translate (const V3d_TypeOfAxe Axe, const double Length, const bool Start=true)
 Movement of the eye and the view point parallel to one of the axes of the fame of reference of the view a distance relative to the initial position expressed by Start = true.
 
void Translate (const double Length, const bool Start=true)
 Movement of the eye and view point parallel to the current axis a distance relative to the initial position expressed by Start = true.
 
void Place (const int theXp, const int theYp, const double theZoomFactor=1)
 places the point of the view corresponding at the pixel position x,y at the center of the window and updates the view.
 
void Turn (const double Ax, const double Ay, const double Az, const bool Start=true)
 Rotation of the view point around the frame of reference of the screen for which the origin is the eye of the projection with a relative angular value in RADIANS with respect to the initial position expressed by Start = true.
 
void Turn (const V3d_TypeOfAxe Axe, const double Angle, const bool Start=true)
 Rotation of the view point around one of the axes of the frame of reference of the view for which the origin is the eye of the projection with an angular value in RADIANS relative to the initial position expressed by Start = true.
 
void Turn (const double Angle, const bool Start=true)
 Rotation of the view point around the current axis an angular value in RADIANS relative to the initial position expressed by Start = true.
 
void SetTwist (const double Angle)
 Defines the angular position of the high point of the reference frame of the view with respect to the Y screen axis with an absolute angular value in RADIANS.
 
void SetEye (const double X, const double Y, const double Z)
 Defines the position of the eye..
 
void SetDepth (const double Depth)
 Defines the Depth of the eye from the view point without update the projection .
 
void SetProj (const double Vx, const double Vy, const double Vz)
 Defines the orientation of the projection.
 
void SetProj (const V3d_TypeOfOrientation theOrientation, const bool theIsYup=false)
 Defines the orientation of the projection .
 
void SetAt (const double X, const double Y, const double Z)
 Defines the position of the view point.
 
void SetUp (const double Vx, const double Vy, const double Vz)
 Defines the orientation of the high point.
 
void SetUp (const V3d_TypeOfOrientation Orientation)
 Defines the orientation(SO) of the high point.
 
void SetViewOrientationDefault ()
 Saves the current state of the orientation of the view which will be the return state at ResetViewOrientation.
 
void ResetViewOrientation ()
 Resets the orientation of the view. Updates the view.
 
void Panning (const double theDXv, const double theDYv, const double theZoomFactor=1, const bool theToStart=true)
 Translates the center of the view along "x" and "y" axes of view projection. Can be used to perform interactive panning operation. In that case the DXv, DXy parameters specify panning relative to the point where the operation is started.
 
void SetCenter (const int theXp, const int theYp)
 Relocates center of screen to the point, determined by {Xp, Yp} pixel coordinates relative to the bottom-left corner of screen. To calculate pixel coordinates for any point from world coordinate space, it can be projected using "Project".
 
void SetSize (const double theSize)
 Defines the view projection size in its maximum dimension, keeping the initial height/width ratio unchanged.
 
void SetZSize (const double SetZSize)
 Defines the Depth size of the view Front Plane will be set to Size/2. Back Plane will be set to -Size/2. Any Object located Above the Front Plane or behind the Back Plane will be Clipped . NOTE than the XY Size of the View is NOT modified .
 
void SetZoom (const double Coef, const bool Start=true)
 Zooms the view by a factor relative to the initial value expressed by Start = true Updates the view.
 
void SetScale (const double Coef)
 Zooms the view by a factor relative to the value initialised by SetViewMappingDefault(). Updates the view.
 
void SetAxialScale (const double Sx, const double Sy, const double Sz)
 Sets anisotropic (axial) scale factors <Sx>, <Sy>, <Sz> for view <me>. Anisotropic scaling operation is performed through multiplying the current view orientation matrix by a scaling matrix: || Sx 0 0 0 || || 0 Sy 0 0 || || 0 0 Sz 0 || || 0 0 0 1 || Updates the view.
 
void FitAll (const double theMargin=0.01, const bool theToUpdate=true)
 Adjust view parameters to fit the displayed scene, respecting height / width ratio. The Z clipping range (depth range) is fitted if AutoZFit flag is TRUE. Throws program error exception if margin coefficient is < 0 or >= 1. Updates the view.
 
void FitAll (const Bnd_Box &theBox, const double theMargin=0.01, const bool theToUpdate=true)
 Adjust view parameters to fit the displayed scene, respecting height / width ratio according to the custom bounding box given. Throws program error exception if margin coefficient is < 0 or >= 1. Updates the view.
 
void DepthFitAll (const double Aspect=0.01, const double Margin=0.01)
 Adjusts the viewing volume so as not to clip the displayed objects by front and back and back clipping planes. Also sets depth value automatically depending on the calculated Z size and Aspect parameter. NOTE than the original XY size of the view is NOT modified .
 
void FitAll (const double theMinXv, const double theMinYv, const double theMaxXv, const double theMaxYv)
 Centers the defined projection window so that it occupies the maximum space while respecting the initial height/width ratio. NOTE than the original Z size of the view is NOT modified .
 
void WindowFit (const int theMinXp, const int theMinYp, const int theMaxXp, const int theMaxYp)
 Centers the defined PIXEL window so that it occupies the maximum space while respecting the initial height/width ratio. NOTE than the original Z size of the view is NOT modified.
 
void SetViewMappingDefault ()
 Saves the current view mapping. This will be the state returned from ResetViewmapping.
 
void ResetViewMapping ()
 Resets the centering of the view. Updates the view.
 
void Reset (const bool theToUpdate=true)
 Resets the centering and the orientation of the view.
 
double Convert (const int Vp) const
 Converts the PIXEL value to a value in the projection plane.
 
void Convert (const int Xp, const int Yp, double &Xv, double &Yv) const
 Converts the point PIXEL into a point projected in the reference frame of the projection plane.
 
int Convert (const double Vv) const
 Converts tha value of the projection plane into a PIXEL value.
 
void Convert (const double Xv, const double Yv, int &Xp, int &Yp) const
 Converts the point defined in the reference frame of the projection plane into a point PIXEL.
 
void Convert (const int Xp, const int Yp, double &X, double &Y, double &Z) const
 Converts the projected point into a point in the reference frame of the view corresponding to the intersection with the projection plane of the eye/view point vector.
 
void ConvertWithProj (const int Xp, const int Yp, double &X, double &Y, double &Z, double &Vx, double &Vy, double &Vz) const
 Converts the projected point into a point in the reference frame of the view corresponding to the intersection with the projection plane of the eye/view point vector and returns the projection ray for further computations.
 
void ConvertToGrid (const int Xp, const int Yp, double &Xg, double &Yg, double &Zg) const
 Converts the projected point into the nearest grid point in the reference frame of the view corresponding to the intersection with the projection plane of the eye/view point vector and display the grid marker. Warning: When the grid is not active the result is identical to the above Convert() method. How to use: 1) Enable the grid echo display myViewer->SetGridEcho(true); 2) When application receive a move event: 2.1) Check if any object is detected if( myInteractiveContext->MoveTo(x,y) == AIS_SOD_Nothing ) { 2.2) Check if the grid is active if( myViewer->Grid()->IsActive() ) { 2.3) Display the grid echo and gets the grid point myView->ConvertToGrid(x,y,X,Y,Z); myView->Viewer()->ShowGridEcho (myView, Graphic3d_Vertex (X,Y,Z)); myView->RedrawImmediate(); 2.4) Else this is the standard case } else myView->Convert(x,y,X,Y,Z);.
 
void ConvertToGrid (const double X, const double Y, const double Z, double &Xg, double &Yg, double &Zg) const
 Converts the point into the nearest grid point and display the grid marker.
 
void Convert (const double X, const double Y, const double Z, int &Xp, int &Yp) const
 Projects the point defined in the reference frame of the view into the projected point in the associated window.
 
void Project (const double theX, const double theY, const double theZ, double &theXp, double &theYp) const
 Converts the point defined in the user space of the view to the projection plane at the depth relative to theZ.
 
void Project (const double theX, const double theY, const double theZ, double &theXp, double &theYp, double &theZp) const
 Converts the point defined in the user space of the view to the projection plane at the depth relative to theZ.
 
void BackgroundColor (const Quantity_TypeOfColor Type, double &V1, double &V2, double &V3) const
 Returns the Background color values of the view depending of the color Type.
 
Quantity_Color BackgroundColor () const
 Returns the Background color object of the view.
 
void GradientBackgroundColors (Quantity_Color &theColor1, Quantity_Color &theColor2) const
 Returns the gradient background colors of the view.
 
Aspect_GradientBackground GradientBackground () const
 Returns the gradient background of the view.
 
double Scale () const
 Returns the current value of the zoom expressed with respect to SetViewMappingDefault().
 
void AxialScale (double &Sx, double &Sy, double &Sz) const
 Returns the current values of the anisotropic (axial) scale factors.
 
void Size (double &Width, double &Height) const
 Returns the height and width of the view.
 
double ZSize () const
 Returns the Depth of the view .
 
void Eye (double &X, double &Y, double &Z) const
 Returns the position of the eye.
 
void FocalReferencePoint (double &X, double &Y, double &Z) const
 Returns the position of point which emanating the projections.
 
void ProjReferenceAxe (const int Xpix, const int Ypix, double &XP, double &YP, double &ZP, double &VX, double &VY, double &VZ) const
 Returns the coordinate of the point (Xpix,Ypix) in the view (XP,YP,ZP), and the projection vector of the view passing by the point (for PerspectiveView).
 
double Depth () const
 Returns the Distance between the Eye and View Point.
 
void Proj (double &Vx, double &Vy, double &Vz) const
 Returns the projection vector.
 
void At (double &X, double &Y, double &Z) const
 Returns the position of the view point.
 
void Up (double &Vx, double &Vy, double &Vz) const
 Returns the vector giving the position of the high point.
 
double Twist () const
 Returns in RADIANS the orientation of the view around the visual axis measured from the Y axis of the screen.
 
Graphic3d_TypeOfShadingModel ShadingModel () const
 Returns the current shading model; Graphic3d_TypeOfShadingModel_Phong by default.
 
void SetShadingModel (const Graphic3d_TypeOfShadingModel theShadingModel)
 Defines the shading model for the visualization.
 
occ::handle< Graphic3d_TextureEnvTextureEnv () const
 
V3d_TypeOfVisualization Visualization () const
 Returns the current visualisation mode.
 
const NCollection_List< occ::handle< Graphic3d_CLight > > & ActiveLights () const
 Returns a list of active lights.
 
NCollection_List< occ::handle< Graphic3d_CLight > >::Iterator ActiveLightIterator () const
 Return iterator for defined lights.
 
int LightLimit () const
 Returns the MAX number of light associated to the view.
 
occ::handle< V3d_ViewerViewer () const
 Returns the viewer in which the view has been created.
 
bool IfWindow () const
 Returns True if MyView is associated with a window .
 
const occ::handle< Aspect_Window > & Window () const
 Returns the Aspect Window associated with the view.
 
V3d_TypeOfView Type () const
 Returns the Type of the View.
 
void Pan (const int theDXp, const int theDYp, const double theZoomFactor=1, const bool theToStart=true)
 Translates the center of the view along "x" and "y" axes of view projection. Can be used to perform interactive panning operation. In that case the DXp, DXp parameters specify panning relative to the point where the operation is started.
 
void Zoom (const int theXp1, const int theYp1, const int theXp2, const int theYp2)
 Zoom the view according to a zoom factor computed from the distance between the 2 mouse position.
 
void StartZoomAtPoint (const int theXp, const int theYp)
 Defines starting point for ZoomAtPoint view operation.
 
void ZoomAtPoint (const int theMouseStartX, const int theMouseStartY, const int theMouseEndX, const int theMouseEndY)
 Zooms the model at a pixel defined by the method StartZoomAtPoint().
 
void AxialScale (const int Dx, const int Dy, const V3d_TypeOfAxe Axis)
 Performs anisotropic scaling of <me> view along the given <Axis>. The scale factor is calculated on a basis of the mouse pointer displacement <Dx,Dy>. The calculated scale factor is then passed to SetAxialScale(Sx, Sy, Sz) method.
 
void StartRotation (const int X, const int Y, const double zRotationThreshold=0.0)
 Begin the rotation of the view around the screen axis according to the mouse position <X,Y>. Warning: Enable rotation around the Z screen axis when <zRotationThreshold> factor is > 0 soon the distance from the start point and the center of the view is > (medium viewSize * <zRotationThreshold> ). Generally a value of 0.4 is usable to rotate around XY screen axis inside the circular threshold area and to rotate around Z screen axis outside this area.
 
void Rotation (const int X, const int Y)
 Continues the rotation of the view with an angle computed from the last and new mouse position <X,Y>.
 
void SetFocale (const double Focale)
 Change View Plane Distance for Perspective Views Warning! raises TypeMismatch from Standard if the view is not a perspective view.
 
double Focale () const
 Returns the View Plane Distance for Perspective Views.
 
const occ::handle< Graphic3d_CView > & View () const
 Returns the associated Graphic3d view.
 
void SetComputedMode (const bool theMode)
 Switches computed HLR mode in the view.
 
bool ComputedMode () const
 Returns the computed HLR mode state.
 
void WindowFitAll (const int Xmin, const int Ymin, const int Xmax, const int Ymax)
 idem than WindowFit
 
bool FitMinMax (const occ::handle< Graphic3d_Camera > &theCamera, const Bnd_Box &theBox, const double theMargin, const double theResolution=0.0, const bool theToEnlargeIfLine=true) const
 Transform camera eye, center and scale to fit in the passed bounding box specified in WCS.
 
void SetGrid (const gp_Ax3 &aPlane, const occ::handle< Aspect_Grid > &aGrid)
 Defines or updates the grid plane and snap object on this view.
 
void SetGridActivity (const bool aFlag)
 Activates / deactivates snap on this view.
 
void GridDisplay (const Aspect_GridParams &theParams)
 Display a shader-rendered grid on the viewer's privileged plane.
 
void GridDisplay (const Aspect_GridParams &theParams, const gp_Ax3 &thePlane)
 Display a shader-rendered grid on an explicit plane (overrides the viewer's privileged plane for this view only).
 
void GridErase ()
 Erase the shader-rendered grid from this view.
 
bool Dump (const char *const theFile, const Graphic3d_BufferType &theBufferType=Graphic3d_BT_RGB)
 Dumps the full contents of the View into the image file. This is an alias for ToPixMap() with Image_AlienPixMap.
 
bool ToPixMap (Image_PixMap &theImage, const V3d_ImageDumpOptions &theParams)
 Dumps the full contents of the view to a pixmap with specified parameters. Internally this method calls Redraw() with an offscreen render buffer of requested target size (theWidth x theHeight), so that there is no need resizing a window control for making a dump of different size.
 
bool ToPixMap (Image_PixMap &theImage, const int theWidth, const int theHeight, const Graphic3d_BufferType &theBufferType=Graphic3d_BT_RGB, const bool theToAdjustAspect=true, const Graphic3d_ZLayerId theTargetZLayerId=Graphic3d_ZLayerId_BotOSD, const int theIsSingleLayer=false, const V3d_StereoDumpOptions theStereoOptions=V3d_SDO_MONO, const char *const theLightName="")
 Dumps the full contents of the view to a pixmap. Internally this method calls Redraw() with an offscreen render buffer of requested target size (theWidth x theHeight), so that there is no need resizing a window control for making a dump of different size.
 
void SetBackFacingModel (const Graphic3d_TypeOfBackfacingModel theModel=Graphic3d_TypeOfBackfacingModel_Auto)
 Manages display of the back faces.
 
Graphic3d_TypeOfBackfacingModel BackFacingModel () const
 Returns current state of the back faces display; Graphic3d_TypeOfBackfacingModel_Auto by default, which means that backface culling is defined by each presentation.
 
virtual void AddClipPlane (const occ::handle< Graphic3d_ClipPlane > &thePlane)
 Adds clip plane to the view. The composition of clip planes truncates the rendering space to convex volume. Number of supported clip planes can be consulted by PlaneLimit method of associated Graphic3d_GraphicDriver. Please be aware that the planes which exceed the limit are ignored during rendering.
 
virtual void RemoveClipPlane (const occ::handle< Graphic3d_ClipPlane > &thePlane)
 Removes clip plane from the view.
 
const occ::handle< Graphic3d_SequenceOfHClipPlane > & ClipPlanes () const
 Get clip planes.
 
void SetClipPlanes (const occ::handle< Graphic3d_SequenceOfHClipPlane > &thePlanes)
 Sets sequence of clip planes to the view. The planes that have been set before are removed from the view. The composition of clip planes truncates the rendering space to convex volume. Number of supported clip planes can be consulted by InquirePlaneLimit method of Graphic3d_GraphicDriver. Please be aware that the planes that exceed the limit are ignored during rendering.
 
int PlaneLimit () const
 Returns the MAX number of clipping planes associated to the view.
 
void SetCamera (const occ::handle< Graphic3d_Camera > &theCamera)
 Change camera used by view.
 
const occ::handle< Graphic3d_Camera > & Camera () const
 Returns camera object of the view.
 
const occ::handle< Graphic3d_Camera > & DefaultCamera () const
 Return default camera.
 
const Graphic3d_RenderingParamsRenderingParams () const
 Returns current rendering parameters and effect settings. By default it returns default parameters of current viewer. To define view-specific settings use method V3d_View::ChangeRenderingParams().
 
Graphic3d_RenderingParamsChangeRenderingParams ()
 Returns reference to current rendering parameters and effect settings.
 
bool IsCullingEnabled () const
 
void SetFrustumCulling (bool theMode)
 Turn on/off automatic culling of objects outside frustum (ON by default)
 
void DiagnosticInformation (NCollection_IndexedDataMap< TCollection_AsciiString, TCollection_AsciiString > &theDict, Graphic3d_DiagnosticInfo theFlags) const
 Fill in the dictionary with diagnostic info. Should be called within rendering thread.
 
TCollection_AsciiString StatisticInformation () const
 Returns string with statistic performance info.
 
void StatisticInformation (NCollection_IndexedDataMap< TCollection_AsciiString, TCollection_AsciiString > &theDict) const
 Fills in the dictionary with statistic performance info.
 
gp_Pnt GravityPoint () const
 Returns the Objects number and the gravity center of ALL viewable points in the view.
 
void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
 Dumps the content of me into the stream.
 
bool IsSubview () const
 Return parent View or NULL if this is not a subview.
 
V3d_ViewParentView ()
 Return parent View or NULL if this is not a subview.
 
const NCollection_Sequence< occ::handle< V3d_View > > & Subviews () const
 Return subview list.
 
occ::handle< V3d_ViewPickSubview (const NCollection_Vec2< int > &thePnt) const
 Pick subview from the given 2D point.
 
void AddSubview (const occ::handle< V3d_View > &theView)
 Add subview to the list.
 
bool RemoveSubview (const V3d_View *theView)
 Remove subview from the list.
 
bool IfMoreLights () const
 initializes an iteration on the active Lights.
 
void InitActiveLights ()
 initializes an iteration 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
 
- 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.
 

Static Public Member Functions

static bool IsCurrentViewIn2DMode ()
 Returns true if active view in 2D mode.
 
static void SetCurrentView2DMode (bool theIs2d)
 Set if active view in 2D mode.
 
- 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.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Protected Member Functions inherited from V3d_View
void ImmediateUpdate () const
 initializes an iteration on the active Lights.
 
void Scale (const occ::handle< Graphic3d_Camera > &theCamera, const double theSizeXv, const double theSizeYv) const
 Scales camera to fit the view frame of defined width and height keeping the aspect. For orthogonal camera the method changes scale, for perspective adjusts Eye location about the Center point.
 
void Translate (const occ::handle< Graphic3d_Camera > &theCamera, const double theDXv, const double theDYv) const
 initializes an iteration on the active Lights.
 
- Protected Attributes inherited from V3d_View
double myOldMouseX
 initializes an iteration on the active Lights.
 
double myOldMouseY
 initializes an iteration on the active Lights.
 
gp_Dir myCamStartOpUp
 initializes an iteration on the active Lights.
 
gp_Dir myCamStartOpDir
 initializes an iteration on the active Lights.
 
gp_Pnt myCamStartOpEye
 initializes an iteration on the active Lights.
 
gp_Pnt myCamStartOpCenter
 initializes an iteration on the active Lights.
 
occ::handle< Graphic3d_CameramyDefaultCamera
 initializes an iteration on the active Lights.
 
occ::handle< Graphic3d_CViewmyView
 initializes an iteration on the active Lights.
 
bool myImmediateUpdate
 initializes an iteration on the active Lights.
 
bool myIsInvalidatedImmediate
 initializes an iteration on the active Lights.
 

Detailed Description

Setting additional flag to store 2D mode of the View to avoid scene rotation by mouse/key events.

Constructor & Destructor Documentation

◆ ViewerTest_V3dView() [1/2]

ViewerTest_V3dView::ViewerTest_V3dView ( const occ::handle< V3d_Viewer > & theViewer,
const V3d_TypeOfView theType = V3d_ORTHOGRAPHIC,
bool theIs2dMode = false )

Initializes the view.

◆ ViewerTest_V3dView() [2/2]

ViewerTest_V3dView::ViewerTest_V3dView ( const occ::handle< V3d_Viewer > & theViewer,
const occ::handle< V3d_View > & theView )

Initializes the view by copying.

Member Function Documentation

◆ IsCurrentViewIn2DMode()

static bool ViewerTest_V3dView::IsCurrentViewIn2DMode ( )
static

Returns true if active view in 2D mode.

◆ IsViewIn2DMode()

bool ViewerTest_V3dView::IsViewIn2DMode ( ) const
inline

Returns true if 2D mode is set for the view.

◆ SetCurrentView2DMode()

static void ViewerTest_V3dView::SetCurrentView2DMode ( bool theIs2d)
static

Set if active view in 2D mode.

◆ SetView2DMode()

void ViewerTest_V3dView::SetView2DMode ( bool the2dMode)
inline

Sets 2D mode for the view.


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