Open CASCADE Technology  7.4.0
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 Handle< V3d_Viewer > &theViewer, const V3d_TypeOfView theType=V3d_ORTHOGRAPHIC, bool theIs2dMode=false)
 Initializes the view. More...
 
 ViewerTest_V3dView (const Handle< V3d_Viewer > &theViewer, const Handle< V3d_View > &theView)
 Initializes the view by copying. More...
 
bool IsViewIn2DMode () const
 Returns true if 2D mode is set for the view. More...
 
void SetView2DMode (bool the2dMode)
 Sets 2D mode for the view. More...
 
- Public Member Functions inherited from V3d_View
 V3d_View (const Handle< V3d_Viewer > &theViewer, const V3d_TypeOfView theType=V3d_ORTHOGRAPHIC)
 Initializes the view. More...
 
 V3d_View (const Handle< V3d_Viewer > &theViewer, const Handle< V3d_View > &theView)
 Initializes the view by copying. More...
 
virtual ~V3d_View ()
 Default destructor. More...
 
void SetWindow (const Handle< Aspect_Window > &theWindow, const Aspect_RenderingContext theContext=NULL)
 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. More...
 
void SetMagnify (const Handle< Aspect_Window > &theWindow, const Handle< V3d_View > &thePreviousView, const Standard_Integer theX1, const Standard_Integer theY1, const Standard_Integer theX2, const Standard_Integer theY2)
 
void Remove () const
 Destroys the view. More...
 
void Update () const
 Deprecated, Redraw() should be used instead. More...
 
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 ) . More...
 
virtual void RedrawImmediate () const
 Updates layer of immediate presentations. More...
 
void Invalidate () const
 Invalidates view content but does not redraw it. More...
 
Standard_Boolean IsInvalidated () const
 Returns true if cached view content has been invalidated. More...
 
Standard_Boolean IsInvalidatedImmediate () const
 Returns true if immediate layer content has been invalidated. More...
 
void InvalidateImmediate ()
 Invalidates view content within immediate layer but does not redraw it. More...
 
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. More...
 
void DoMapping ()
 Must be called when the window supporting the view is mapped or unmapped. More...
 
Standard_Boolean IsEmpty () const
 Returns the status of the view regarding the displayed structures inside Returns True is The View is empty. More...
 
void UpdateLights () const
 Updates the lights of the view. 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 () const
 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) const
 Change Z-min and Z-max planes of projection volume to match the displayed objects. More...
 
void SetBackgroundColor (const Quantity_TypeOfColor theType, const Standard_Real theV1, const Standard_Real theV2, const Standard_Real theV3)
 Defines the background color of the view by the color definition type and the three corresponding values. More...
 
void SetBackgroundColor (const Quantity_Color &theColor)
 Defines the background color of the view. More...
 
void SetBgGradientColors (const Quantity_Color &theColor1, const Quantity_Color &theColor2, const Aspect_GradientFillMethod theFillStyle=Aspect_GFM_HOR, const Standard_Boolean theToUpdate=Standard_False)
 Defines the gradient background colors of the view by supplying the colors and the fill method (horizontal by default). More...
 
void SetBgGradientStyle (const Aspect_GradientFillMethod theMethod=Aspect_GFM_HOR, const Standard_Boolean theToUpdate=Standard_False)
 Defines the gradient background fill method of the view. More...
 
void SetBackgroundImage (const Standard_CString theFileName, const Aspect_FillMethod theFillStyle=Aspect_FM_CENTERED, const Standard_Boolean theToUpdate=Standard_False)
 Defines the background texture of the view by supplying the texture image file name and fill method (centered by default). More...
 
void SetBgImageStyle (const Aspect_FillMethod theFillStyle, const Standard_Boolean theToUpdate=Standard_False)
 Defines the textured background fill method of the view. More...
 
void SetBackgroundCubeMap (const Handle< Graphic3d_CubeMap > &theCubeMap, Standard_Boolean theToUpdate=Standard_False)
 Sets environment cubemap as interactive background. More...
 
void SetAxis (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Real Vx, const Standard_Real Vy, const Standard_Real 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. . More...
 
void SetShadingModel (const Graphic3d_TypeOfShadingModel theShadingModel)
 Defines the shading model for the visualization. Various models are available. More...
 
void SetTextureEnv (const Handle< Graphic3d_TextureEnv > &theTexture)
 Sets the environment texture to use. No environment texture by default. More...
 
void SetVisualization (const V3d_TypeOfVisualization theType)
 Defines the visualization type in the view. More...
 
void SetLightOn (const Handle< V3d_Light > &theLight)
 Activates theLight in the view. More...
 
void SetLightOn ()
 Activates all the lights defined in this view. More...
 
void SetLightOff (const Handle< V3d_Light > &theLight)
 Deactivate theLight in this view. More...
 
void SetLightOff ()
 Deactivate all the Lights defined in this view. More...
 
Standard_Boolean IsActiveLight (const Handle< V3d_Light > &theLight) const
 Returns TRUE when the light is active in this view. More...
 
Standard_Boolean SetImmediateUpdate (const Standard_Boolean theImmediateUpdate)
 sets the immediate update mode and returns the previous one. More...
 
void ZBufferTriedronSetup (const Quantity_Color &theXColor=Quantity_NOC_RED, const Quantity_Color &theYColor=Quantity_NOC_GREEN, const Quantity_Color &theZColor=Quantity_NOC_BLUE1, const Standard_Real theSizeRatio=0.8, const Standard_Real theAxisDiametr=0.05, const Standard_Integer 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. More...
 
void TriedronDisplay (const Aspect_TypeOfTriedronPosition thePosition=Aspect_TOTP_CENTER, const Quantity_Color &theColor=Quantity_NOC_WHITE, const Standard_Real 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. More...
 
void TriedronErase ()
 Erases the Triedron. More...
 
const Graphic3d_GraduatedTrihedronGetGraduatedTrihedron () const
 Returns data of a graduated trihedron. More...
 
void GraduatedTrihedronDisplay (const Graphic3d_GraduatedTrihedron &theTrihedronData)
 Displays a graduated trihedron. More...
 
void GraduatedTrihedronErase ()
 Erases a graduated trihedron from the view. More...
 
void SetFront ()
 modify the Projection of the view perpendicularly to the privileged plane of the viewer. More...
 
void Rotate (const Standard_Real Ax, const Standard_Real Ay, const Standard_Real Az, const Standard_Boolean Start=Standard_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 = Standard_True Warning! raises BadValue from V3d If the eye, the view point, or the high point are aligned or confused. More...
 
void Rotate (const Standard_Real Ax, const Standard_Real Ay, const Standard_Real Az, const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Boolean Start=Standard_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 = Standard_True If the eye, the view point, or the high point are aligned or confused. More...
 
void Rotate (const V3d_TypeOfAxe Axe, const Standard_Real Angle, const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Boolean Start=Standard_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 = Standard_True. More...
 
void Rotate (const V3d_TypeOfAxe Axe, const Standard_Real Angle, const Standard_Boolean Start=Standard_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 = Standard_True. More...
 
void Rotate (const Standard_Real Angle, const Standard_Boolean Start=Standard_True)
 Rotates the eye around the current axis a relative angular value in RADIANS with respect to the initial position expressed by Start = Standard_True. More...
 
void Move (const Standard_Real Dx, const Standard_Real Dy, const Standard_Real Dz, const Standard_Boolean Start=Standard_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 = Standard_True. More...
 
void Move (const V3d_TypeOfAxe Axe, const Standard_Real Length, const Standard_Boolean Start=Standard_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 = Standard_True. More...
 
void Move (const Standard_Real Length, const Standard_Boolean Start=Standard_True)
 Movement of the eye parllel to the current axis a distance relative to the initial position expressed by Start = Standard_True. More...
 
void Translate (const Standard_Real Dx, const Standard_Real Dy, const Standard_Real Dz, const Standard_Boolean Start=Standard_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 = Standard_True. More...
 
void Translate (const V3d_TypeOfAxe Axe, const Standard_Real Length, const Standard_Boolean Start=Standard_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 = Standard_True. More...
 
void Translate (const Standard_Real Length, const Standard_Boolean Start=Standard_True)
 Movement of the eye and view point parallel to the current axis a distance relative to the initial position expressed by Start = Standard_True. More...
 
void Place (const Standard_Integer theXp, const Standard_Integer theYp, const Standard_Real 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. More...
 
void Turn (const Standard_Real Ax, const Standard_Real Ay, const Standard_Real Az, const Standard_Boolean Start=Standard_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 = Standard_True. More...
 
void Turn (const V3d_TypeOfAxe Axe, const Standard_Real Angle, const Standard_Boolean Start=Standard_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 = Standard_True. More...
 
void Turn (const Standard_Real Angle, const Standard_Boolean Start=Standard_True)
 Rotation of the view point around the current axis an angular value in RADIANS relative to the initial position expressed by Start = Standard_True. More...
 
void SetTwist (const Standard_Real 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. More...
 
void SetEye (const Standard_Real X, const Standard_Real Y, const Standard_Real Z)
 Defines the position of the eye.. More...
 
void SetDepth (const Standard_Real Depth)
 Defines the Depth of the eye from the view point without update the projection . More...
 
void SetProj (const Standard_Real Vx, const Standard_Real Vy, const Standard_Real Vz)
 Defines the orientation of the projection. More...
 
void SetProj (const V3d_TypeOfOrientation theOrientation, const Standard_Boolean theIsYup=Standard_False)
 Defines the orientation of the projection . More...
 
void SetAt (const Standard_Real X, const Standard_Real Y, const Standard_Real Z)
 Defines the position of the view point. More...
 
void SetUp (const Standard_Real Vx, const Standard_Real Vy, const Standard_Real Vz)
 Defines the orientation of the high point. More...
 
void SetUp (const V3d_TypeOfOrientation Orientation)
 Defines the orientation(SO) of the high point. More...
 
void SetViewOrientationDefault ()
 Saves the current state of the orientation of the view which will be the return state at ResetViewOrientation. More...
 
void ResetViewOrientation ()
 Resets the orientation of the view. Updates the view. More...
 
void Panning (const Standard_Real theDXv, const Standard_Real theDYv, const Standard_Real theZoomFactor=1, const Standard_Boolean theToStart=Standard_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. More...
 
void SetCenter (const Standard_Integer theXp, const Standard_Integer 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". More...
 
void SetSize (const Standard_Real theSize)
 Defines the view projection size in its maximum dimension, keeping the inital height/width ratio unchanged. More...
 
void SetZSize (const Standard_Real 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 . More...
 
void SetZoom (const Standard_Real Coef, const Standard_Boolean Start=Standard_True)
 Zooms the view by a factor relative to the initial value expressed by Start = Standard_True Updates the view. More...
 
void SetScale (const Standard_Real Coef)
 Zooms the view by a factor relative to the value initialised by SetViewMappingDefault(). Updates the view. More...
 
void SetAxialScale (const Standard_Real Sx, const Standard_Real Sy, const Standard_Real 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. More...
 
void FitAll (const Standard_Real theMargin=0.01, const Standard_Boolean theToUpdate=Standard_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. More...
 
void FitAll (const Bnd_Box &theBox, const Standard_Real theMargin=0.01, const Standard_Boolean theToUpdate=Standard_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. More...
 
void DepthFitAll (const Standard_Real Aspect=0.01, const Standard_Real 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 . More...
 
void FitAll (const Standard_Real theMinXv, const Standard_Real theMinYv, const Standard_Real theMaxXv, const Standard_Real 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 . More...
 
void WindowFit (const Standard_Integer theMinXp, const Standard_Integer theMinYp, const Standard_Integer theMaxXp, const Standard_Integer 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. More...
 
void SetViewMappingDefault ()
 Saves the current view mapping. This will be the state returned from ResetViewmapping. More...
 
void ResetViewMapping ()
 Resets the centering of the view. Updates the view. More...
 
void Reset (const Standard_Boolean theToUpdate=Standard_True)
 Resets the centering and the orientation of the view. More...
 
Standard_Real Convert (const Standard_Integer Vp) const
 Converts the PIXEL value to a value in the projection plane. More...
 
void Convert (const Standard_Integer Xp, const Standard_Integer Yp, Standard_Real &Xv, Standard_Real &Yv) const
 Converts the point PIXEL into a point projected in the reference frame of the projection plane. More...
 
Standard_Integer Convert (const Standard_Real Vv) const
 Converts tha value of the projection plane into a PIXEL value. More...
 
void Convert (const Standard_Real Xv, const Standard_Real Yv, Standard_Integer &Xp, Standard_Integer &Yp) const
 Converts the point defined in the reference frame of the projection plane into a point PIXEL. More...
 
void Convert (const Standard_Integer Xp, const Standard_Integer Yp, Standard_Real &X, Standard_Real &Y, Standard_Real &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. More...
 
void ConvertWithProj (const Standard_Integer Xp, const Standard_Integer Yp, Standard_Real &X, Standard_Real &Y, Standard_Real &Z, Standard_Real &Vx, Standard_Real &Vy, Standard_Real &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. More...
 
void ConvertToGrid (const Standard_Integer Xp, const Standard_Integer Yp, Standard_Real &Xg, Standard_Real &Yg, Standard_Real &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(Standard_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);. More...
 
void ConvertToGrid (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, Standard_Real &Xg, Standard_Real &Yg, Standard_Real &Zg) const
 Converts the point into the nearest grid point and display the grid marker. More...
 
void Convert (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, Standard_Integer &Xp, Standard_Integer &Yp) const
 Projects the point defined in the reference frame of the view into the projected point in the associated window. More...
 
void Project (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ, Standard_Real &theXp, Standard_Real &theYp) const
 Converts the point defined in the user space of the view to the projection plane at the depth relative to theZ. More...
 
void Project (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ, Standard_Real &theXp, Standard_Real &theYp, Standard_Real &theZp) const
 Converts the point defined in the user space of the view to the projection plane at the depth relative to theZ. More...
 
void BackgroundColor (const Quantity_TypeOfColor Type, Standard_Real &V1, Standard_Real &V2, Standard_Real &V3) const
 Returns the Background color values of the view depending of the color Type. More...
 
Quantity_Color BackgroundColor () const
 Returns the Background color object of the view. More...
 
void GradientBackgroundColors (Quantity_Color &theColor1, Quantity_Color &theColor2) const
 Returns the gradient background colors of the view. More...
 
Aspect_GradientBackground GradientBackground () const
 Returns the gradient background of the view. More...
 
Standard_Real Scale () const
 Returns the current value of the zoom expressed with respect to SetViewMappingDefault(). More...
 
void AxialScale (Standard_Real &Sx, Standard_Real &Sy, Standard_Real &Sz) const
 Returns the current values of the anisotropic (axial) scale factors. More...
 
void Size (Standard_Real &Width, Standard_Real &Height) const
 Returns the height and width of the view. More...
 
Standard_Real ZSize () const
 Returns the Depth of the view . More...
 
void Eye (Standard_Real &X, Standard_Real &Y, Standard_Real &Z) const
 Returns the position of the eye. More...
 
void FocalReferencePoint (Standard_Real &X, Standard_Real &Y, Standard_Real &Z) const
 Returns the position of point which emanating the projections. More...
 
void ProjReferenceAxe (const Standard_Integer Xpix, const Standard_Integer Ypix, Standard_Real &XP, Standard_Real &YP, Standard_Real &ZP, Standard_Real &VX, Standard_Real &VY, Standard_Real &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). More...
 
Standard_Real Depth () const
 Returns the Distance between the Eye and View Point. More...
 
void Proj (Standard_Real &Vx, Standard_Real &Vy, Standard_Real &Vz) const
 Returns the projection vector. More...
 
void At (Standard_Real &X, Standard_Real &Y, Standard_Real &Z) const
 Returns the position of the view point. More...
 
void Up (Standard_Real &Vx, Standard_Real &Vy, Standard_Real &Vz) const
 Returns the vector giving the position of the high point. More...
 
Standard_Real Twist () const
 Returns in RADIANS the orientation of the view around the visual axis measured from the Y axis of the screen. More...
 
Graphic3d_TypeOfShadingModel ShadingModel () const
 Returns the current shading model. More...
 
Handle< Graphic3d_TextureEnvTextureEnv () const
 
V3d_TypeOfVisualization Visualization () const
 Returns the current visualisation mode. More...
 
Standard_Boolean IfMoreLights () const
 Returns True if One light more can be activated in this View. More...
 
V3d_ListOfLightIterator ActiveLightIterator () const
 Return iterator for defined lights. More...
 
void InitActiveLights ()
 initializes an iteration on the active Lights. More...
 
Standard_Boolean MoreActiveLights () const
 returns true if there are more active Light(s) to return. More...
 
void NextActiveLights ()
 Go to the next active Light (if there is not, ActiveLight will raise an exception) More...
 
const Handle< V3d_Light > & ActiveLight () const
 
Standard_Integer LightLimit () const
 Returns the MAX number of light associated to the view. More...
 
Handle< V3d_ViewerViewer () const
 Returns the viewer in which the view has been created. More...
 
Standard_Boolean IfWindow () const
 Returns True if MyView is associated with a window . More...
 
const Handle< Aspect_Window > & Window () const
 Returns the Aspect Window associated with the view. More...
 
V3d_TypeOfView Type () const
 Returns the Type of the View. More...
 
void Pan (const Standard_Integer theDXp, const Standard_Integer theDYp, const Standard_Real theZoomFactor=1, const Standard_Boolean theToStart=Standard_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. More...
 
void Zoom (const Standard_Integer theXp1, const Standard_Integer theYp1, const Standard_Integer theXp2, const Standard_Integer theYp2)
 Zoom the view according to a zoom factor computed from the distance between the 2 mouse position. More...
 
void StartZoomAtPoint (const Standard_Integer theXp, const Standard_Integer theYp)
 Defines starting point for ZoomAtPoint view operation. More...
 
void ZoomAtPoint (const Standard_Integer theMouseStartX, const Standard_Integer theMouseStartY, const Standard_Integer theMouseEndX, const Standard_Integer theMouseEndY)
 Zooms the model at a pixel defined by the method StartZoomAtPoint(). More...
 
void AxialScale (const Standard_Integer Dx, const Standard_Integer 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. More...
 
void StartRotation (const Standard_Integer X, const Standard_Integer Y, const Standard_Real 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. More...
 
void Rotation (const Standard_Integer X, const Standard_Integer Y)
 Continues the rotation of the view with an angle computed from the last and new mouse position <X,Y>. More...
 
void SetFocale (const Standard_Real Focale)
 Change View Plane Distance for Perspective Views Warning! raises TypeMismatch from Standard if the view is not a perspective view. More...
 
Standard_Real Focale () const
 Returns the View Plane Distance for Perspective Views. More...
 
const Handle< Graphic3d_CView > & View () const
 Returns the associated Graphic3d view. More...
 
void SetComputedMode (const Standard_Boolean theMode)
 Switches computed HLR mode in the view. More...
 
Standard_Boolean ComputedMode () const
 Returns the computed HLR mode state. More...
 
void WindowFitAll (const Standard_Integer Xmin, const Standard_Integer Ymin, const Standard_Integer Xmax, const Standard_Integer Ymax)
 idem than WindowFit More...
 
Standard_Boolean FitMinMax (const Handle< Graphic3d_Camera > &theCamera, const Bnd_Box &theBox, const Standard_Real theMargin, const Standard_Real theResolution=0.0, const Standard_Boolean theToEnlargeIfLine=Standard_True) const
 Transform camera eye, center and scale to fit in the passed bounding box specified in WCS. More...
 
void SetGrid (const gp_Ax3 &aPlane, const Handle< Aspect_Grid > &aGrid)
 Defines or Updates the definition of the grid in <me> More...
 
void SetGridActivity (const Standard_Boolean aFlag)
 Defines or Updates the activity of the grid in <me> More...
 
Standard_Boolean Dump (const Standard_CString 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. More...
 
Standard_Boolean 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. More...
 
Standard_Boolean ToPixMap (Image_PixMap &theImage, const Standard_Integer theWidth, const Standard_Integer theHeight, const Graphic3d_BufferType &theBufferType=Graphic3d_BT_RGB, const Standard_Boolean theToAdjustAspect=Standard_True, const V3d_StereoDumpOptions theStereoOptions=V3d_SDO_MONO)
 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. More...
 
void SetBackFacingModel (const V3d_TypeOfBackfacingModel theModel=V3d_TOBM_AUTOMATIC)
 Manages display of the back faces When <aModel> is TOBM_AUTOMATIC the object backfaces are displayed only for surface objects and never displayed for solid objects. this was the previous mode. <aModel> is TOBM_ALWAYS_DISPLAYED the object backfaces are always displayed both for surfaces or solids. <aModel> is TOBM_NEVER_DISPLAYED the object backfaces are never displayed. More...
 
V3d_TypeOfBackfacingModel BackFacingModel () const
 Returns current state of the back faces display. More...
 
virtual void AddClipPlane (const 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. More...
 
virtual void RemoveClipPlane (const Handle< Graphic3d_ClipPlane > &thePlane)
 Removes clip plane from the view. More...
 
void SetClipPlanes (const 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. More...
 
void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane &thePlanes)
 
const Handle< Graphic3d_SequenceOfHClipPlane > & ClipPlanes () const
 Get clip planes. More...
 
Standard_Integer PlaneLimit () const
 Returns the MAX number of clipping planes associated to the view. More...
 
void SetCamera (const Handle< Graphic3d_Camera > &theCamera)
 Change camera used by view. More...
 
const Handle< Graphic3d_Camera > & Camera () const
 Returns camera object of the view. More...
 
const Handle< Graphic3d_Camera > & DefaultCamera () const
 Return default camera. More...
 
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(). More...
 
Graphic3d_RenderingParamsChangeRenderingParams ()
 Returns reference to current rendering parameters and effect settings. More...
 
Standard_Boolean IsCullingEnabled () const
 
void SetFrustumCulling (Standard_Boolean theMode)
 Turn on/off automatic culling of objects outside frustum (ON by default) More...
 
void DiagnosticInformation (TColStd_IndexedDataMapOfStringString &theDict, Graphic3d_DiagnosticInfo theFlags) const
 Fill in the dictionary with diagnostic info. Should be called within rendering thread. More...
 
TCollection_AsciiString StatisticInformation () const
 Returns string with statistic performance info. More...
 
void StatisticInformation (TColStd_IndexedDataMapOfStringString &theDict) const
 Fills in the dictionary with statistic performance info. More...
 
gp_Pnt GravityPoint () const
 Returns the Objects number and the gravity center of ALL viewable points in the view. 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 void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::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 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. 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...
 
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. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Static Public Member Functions

static bool IsCurrentViewIn2DMode ()
 Returns true if active view in 2D mode. More...
 
static void SetCurrentView2DMode (bool theIs2d)
 Set if active view in 2D mode. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Protected Member Functions inherited from V3d_View
void ImmediateUpdate () const
 
void Scale (const Handle< Graphic3d_Camera > &theCamera, const Standard_Real theSizeXv, const Standard_Real 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. More...
 
void Translate (const Handle< Graphic3d_Camera > &theCamera, const Standard_Real theDXv, const Standard_Real theDYv) const
 
- Protected Attributes inherited from V3d_View
Standard_Real myOldMouseX
 
Standard_Real myOldMouseY
 
gp_Dir myCamStartOpUp
 
gp_Dir myCamStartOpDir
 
gp_Pnt myCamStartOpEye
 
Standard_Real myCamStartOpBnd [6]
 
gp_Pnt myCamStartOpCenter
 
Handle< Graphic3d_CameramyDefaultCamera
 
Handle< Graphic3d_CViewmyView
 
Standard_Boolean myImmediateUpdate
 
Standard_Boolean myIsInvalidatedImmediate
 

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 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 Handle< V3d_Viewer > &  theViewer,
const 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: