OpenLexocad  27.1
OpenLxUI::Viewer Class Reference

#include <Viewer.h>

Public Types

enum  EViewDirection {
  EViewDirection::UNDEFINED, EViewDirection::TOP, EViewDirection::BOTTOM, EViewDirection::FRONT,
  EViewDirection::BACK, EViewDirection::LEFT, EViewDirection::RIGHT, EViewDirection::AXO,
  EViewDirection::AXOLEFT, EViewDirection::AXOBACKRIGHT, EViewDirection::AXOBACKLEFT
}
 

Public Member Functions

 Viewer (Gui::Viewer &aViewer)
 
 Viewer ()=delete
 
virtual ~Viewer ()
 
void lookAt (const Geom::Pnt &fromPnt, const Geom::Pnt &toPnt, const Geom::Vec &upVector)
 
void viewLast ()
 
OpenLxUI::SceneView getCurrentSceneView ()
 
void saveSceneView (OpenLxUI::SceneView &view)
 
void setSceneView (const OpenLxUI::SceneView &view, bool forceNotAnimated=false)
 
bool isZoomViewAvailable () const
 
void saveZoomView ()
 
void viewLastZoomView ()
 
void clearZoomViews ()
 
double getZGroundPlate () const
 
void setZGroundPlate (bool aOn, double val)
 
bool getProjectAllToZGroundPlate () const
 
void setProjectAllToZGroundPlate (bool aOn)
 
bool getProjectAllToWPlane () const
 
void setProjectAllToWPlane (bool aOn)
 
void enablePlaneMode ()
 
void enablePlaneMode (const Geom::Pln &aPln)
 
void disablePlaneMode ()
 
bool getPlaneMode (Geom::Pln &p)
 
void setPlaneMode (const Geom::Pln &aPln)
 
void setActive (bool on)
 
void loadVisibility () const
 
void viewAll (float animationTime=0.f, const Geom::Dir &upVec=Geom::Dir(0, 1, 0), Geom::Bnd_Box *bbox=0)
 
void viewElement (std::shared_ptr< OpenLxApp::Element > e, float animationTime=0.f, const Geom::Dir &upVec=Geom::Dir(0, 1, 0))
 
void viewBoundingBox (Geom::Bnd_Box bbox, float animationTime=0.f, const Geom::Dir &upVec=Geom::Dir(0, 1, 0))
 
void view (EViewDirection direction, float animationTime=0.f, const Geom::Dir &upVec=Geom::Dir(0, 1, 0), Geom::Bnd_Box *bbox=0, double rotZ=0)
 
void viewOrthogonal ()
 
void viewPerspective ()
 
void zoom (const float diffvalue)
 
void zoomToPoint (Geom::Pnt p, double radius, double animateTime)
 
void redraw ()
 
void animateActiveCamera (const Geom::Vec &toPosition, const Geom::Vec &toViewpoint, float animationLength, const double *toFov=0, const double *toRotation=0)
 
void setBackgroundColor (const Base::Color &aColor)
 
Base::Color getBackgroundColor () const
 
bool centeringZoom (float &ppdst, Geom::Ax2 coordsys, bool smallmode=false)
 
void zoomToCursor (Geom::Ax2 coordsys, bool forward)
 
void walkThruMove (int dir, bool orbit, double speed=0.)
 
void setElementVisibilityInViewer (std::shared_ptr< OpenLxApp::Element > e, bool visible)
 
void setElementsVisibilityInViewer (const std::vector< std::shared_ptr< OpenLxApp::Element >> &elems, bool visible)
 
void enableShading (bool on)
 
bool isShading ()
 
Geom::Pnt2d mapToGlobal (const Geom::Pnt2d &in)
 
bool offScreenSaveImage (const std::string &filename)
 
bool offScreenSaveImage (const std::string &filename, int viewportwidth, int viewportheight, const Base::Color &bgColor, bool smoothing, int smoothingPasses)
 
bool saveScreenImage (const Base::String &aFileName)
 
bool saveScreenImage (const Base::String &aFileName, int width, int height, const Base::Color &backgroundColor)
 
bool renderWebThumbnail (const Base::String &aFileName, int width, int height, const Base::Color &backgroundColor)
 
std::string getDefaultCursor ()
 
void setDefaultCursor (const std::string &c)
 
void setDraggingRestriction (bool on)
 
void checkForCameraUpConstrain ()
 
Geom::Bnd_Box getSceneBoundingBox ()
 
bool hasAutomaticFocalDistance () const
 
void setAutomaticFocalDistance (bool on)
 
double getOldFocalDistance () const
 
void setOldFocalDistance (double d)
 
void setBlockRedraw (bool on)
 
void blockRedrawAfterRedrawing (bool on)
 

Detailed Description

Since
28.0

Member Enumeration Documentation

◆ EViewDirection

Enumerator
UNDEFINED 
TOP 
BOTTOM 
FRONT 
BACK 
LEFT 
RIGHT 
AXO 
AXOLEFT 
AXOBACKRIGHT 
AXOBACKLEFT 

Constructor & Destructor Documentation

◆ Viewer() [1/2]

OpenLxUI::Viewer::Viewer ( Gui::Viewer &  aViewer)

◆ Viewer() [2/2]

OpenLxUI::Viewer::Viewer ( )
delete

◆ ~Viewer()

virtual OpenLxUI::Viewer::~Viewer ( )
virtual

Member Function Documentation

◆ animateActiveCamera()

void OpenLxUI::Viewer::animateActiveCamera ( const Geom::Vec toPosition,
const Geom::Vec toViewpoint,
float  animationLength,
const double *  toFov = 0,
const double *  toRotation = 0 
)

Animates the active camera to this position and viewpoint

◆ blockRedrawAfterRedrawing()

void OpenLxUI::Viewer::blockRedrawAfterRedrawing ( bool  on)

◆ centeringZoom()

bool OpenLxUI::Viewer::centeringZoom ( float &  ppdst,
Geom::Ax2  coordsys,
bool  smallmode = false 
)

◆ checkForCameraUpConstrain()

void OpenLxUI::Viewer::checkForCameraUpConstrain ( )

◆ clearZoomViews()

void OpenLxUI::Viewer::clearZoomViews ( )

◆ disablePlaneMode()

void OpenLxUI::Viewer::disablePlaneMode ( )

◆ enablePlaneMode() [1/2]

void OpenLxUI::Viewer::enablePlaneMode ( )

◆ enablePlaneMode() [2/2]

void OpenLxUI::Viewer::enablePlaneMode ( const Geom::Pln aPln)

◆ enableShading()

void OpenLxUI::Viewer::enableShading ( bool  on)

◆ getBackgroundColor()

Base::Color OpenLxUI::Viewer::getBackgroundColor ( ) const

Returns the background color of the viewer

◆ getCurrentSceneView()

OpenLxUI::SceneView OpenLxUI::Viewer::getCurrentSceneView ( )

◆ getDefaultCursor()

std::string OpenLxUI::Viewer::getDefaultCursor ( )

◆ getOldFocalDistance()

double OpenLxUI::Viewer::getOldFocalDistance ( ) const

◆ getPlaneMode()

bool OpenLxUI::Viewer::getPlaneMode ( Geom::Pln p)

◆ getProjectAllToWPlane()

bool OpenLxUI::Viewer::getProjectAllToWPlane ( ) const

◆ getProjectAllToZGroundPlate()

bool OpenLxUI::Viewer::getProjectAllToZGroundPlate ( ) const

◆ getSceneBoundingBox()

Geom::Bnd_Box OpenLxUI::Viewer::getSceneBoundingBox ( )

◆ getZGroundPlate()

double OpenLxUI::Viewer::getZGroundPlate ( ) const

◆ hasAutomaticFocalDistance()

bool OpenLxUI::Viewer::hasAutomaticFocalDistance ( ) const

◆ isShading()

bool OpenLxUI::Viewer::isShading ( )

◆ isZoomViewAvailable()

bool OpenLxUI::Viewer::isZoomViewAvailable ( ) const

◆ loadVisibility()

void OpenLxUI::Viewer::loadVisibility ( ) const

◆ lookAt()

void OpenLxUI::Viewer::lookAt ( const Geom::Pnt fromPnt,
const Geom::Pnt toPnt,
const Geom::Vec upVector 
)

◆ mapToGlobal()

Geom::Pnt2d OpenLxUI::Viewer::mapToGlobal ( const Geom::Pnt2d in)

◆ offScreenSaveImage() [1/2]

bool OpenLxUI::Viewer::offScreenSaveImage ( const std::string &  filename)

◆ offScreenSaveImage() [2/2]

bool OpenLxUI::Viewer::offScreenSaveImage ( const std::string &  filename,
int  viewportwidth,
int  viewportheight,
const Base::Color bgColor,
bool  smoothing,
int  smoothingPasses 
)

◆ redraw()

void OpenLxUI::Viewer::redraw ( )

◆ renderWebThumbnail()

bool OpenLxUI::Viewer::renderWebThumbnail ( const Base::String aFileName,
int  width,
int  height,
const Base::Color backgroundColor 
)

◆ saveSceneView()

void OpenLxUI::Viewer::saveSceneView ( OpenLxUI::SceneView view)

◆ saveScreenImage() [1/2]

bool OpenLxUI::Viewer::saveScreenImage ( const Base::String aFileName)

◆ saveScreenImage() [2/2]

bool OpenLxUI::Viewer::saveScreenImage ( const Base::String aFileName,
int  width,
int  height,
const Base::Color backgroundColor 
)

◆ saveZoomView()

void OpenLxUI::Viewer::saveZoomView ( )

◆ setActive()

void OpenLxUI::Viewer::setActive ( bool  on)

◆ setAutomaticFocalDistance()

void OpenLxUI::Viewer::setAutomaticFocalDistance ( bool  on)

◆ setBackgroundColor()

void OpenLxUI::Viewer::setBackgroundColor ( const Base::Color aColor)

Sets the background color of the viewer

◆ setBlockRedraw()

void OpenLxUI::Viewer::setBlockRedraw ( bool  on)

◆ setDefaultCursor()

void OpenLxUI::Viewer::setDefaultCursor ( const std::string &  c)

◆ setDraggingRestriction()

void OpenLxUI::Viewer::setDraggingRestriction ( bool  on)

◆ setElementsVisibilityInViewer()

void OpenLxUI::Viewer::setElementsVisibilityInViewer ( const std::vector< std::shared_ptr< OpenLxApp::Element >> &  elems,
bool  visible 
)

◆ setElementVisibilityInViewer()

void OpenLxUI::Viewer::setElementVisibilityInViewer ( std::shared_ptr< OpenLxApp::Element e,
bool  visible 
)

◆ setOldFocalDistance()

void OpenLxUI::Viewer::setOldFocalDistance ( double  d)

◆ setPlaneMode()

void OpenLxUI::Viewer::setPlaneMode ( const Geom::Pln aPln)

◆ setProjectAllToWPlane()

void OpenLxUI::Viewer::setProjectAllToWPlane ( bool  aOn)

◆ setProjectAllToZGroundPlate()

void OpenLxUI::Viewer::setProjectAllToZGroundPlate ( bool  aOn)

◆ setSceneView()

void OpenLxUI::Viewer::setSceneView ( const OpenLxUI::SceneView view,
bool  forceNotAnimated = false 
)

◆ setZGroundPlate()

void OpenLxUI::Viewer::setZGroundPlate ( bool  aOn,
double  val 
)

◆ view()

void OpenLxUI::Viewer::view ( EViewDirection  direction,
float  animationTime = 0.f,
const Geom::Dir upVec = Geom::Dir(0, 1, 0),
Geom::Bnd_Box bbox = 0,
double  rotZ = 0 
)

◆ viewAll()

void OpenLxUI::Viewer::viewAll ( float  animationTime = 0.f,
const Geom::Dir upVec = Geom::Dir(0, 1, 0),
Geom::Bnd_Box bbox = 0 
)

◆ viewBoundingBox()

void OpenLxUI::Viewer::viewBoundingBox ( Geom::Bnd_Box  bbox,
float  animationTime = 0.f,
const Geom::Dir upVec = Geom::Dir(0, 1, 0) 
)

◆ viewElement()

void OpenLxUI::Viewer::viewElement ( std::shared_ptr< OpenLxApp::Element e,
float  animationTime = 0.f,
const Geom::Dir upVec = Geom::Dir(0, 1, 0) 
)

◆ viewLast()

void OpenLxUI::Viewer::viewLast ( )

◆ viewLastZoomView()

void OpenLxUI::Viewer::viewLastZoomView ( )

◆ viewOrthogonal()

void OpenLxUI::Viewer::viewOrthogonal ( )

◆ viewPerspective()

void OpenLxUI::Viewer::viewPerspective ( )

◆ walkThruMove()

void OpenLxUI::Viewer::walkThruMove ( int  dir,
bool  orbit,
double  speed = 0. 
)

◆ zoom()

void OpenLxUI::Viewer::zoom ( const float  diffvalue)

◆ zoomToCursor()

void OpenLxUI::Viewer::zoomToCursor ( Geom::Ax2  coordsys,
bool  forward 
)

◆ zoomToPoint()

void OpenLxUI::Viewer::zoomToPoint ( Geom::Pnt  p,
double  radius,
double  animateTime 
)

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