GUI view into a 3D scene provided by View3DInventor. More...
#include <View3DInventorViewer.h>
Public Types | |
enum SelectionMode { Lasso = 0, Rectangle = 1, Rubberband = 2, BoxZoom = 3, Clip = 4 } | |
Pick modes for picking points in the scene. More... | |
Modus handling of the viewer | |
Here you can switch several features on/off and modes of the Viewer | |
enum ViewerMod { ShowCoord =1, ShowFPS =2, SimpleBackground =4, DisallowRotation =8, DisallowPanning =16, DisallowZooming =32 } | |
Anti-Aliasing modes of the rendered 3D scene | |
Specifies Anti-Aliasing (AA) method
| |
enum AntiAliasing { , Smoothing, MSAA2x, MSAA4x, MSAA8x } | |
Public Member Functions | |
Handling of view providers | |
SbBool hasViewProvider (ViewProvider *) const | |
Checks if the view provider is a top-level object of the scene. More... | |
SbBool containsViewProvider (const ViewProvider *) const | |
Checks if the view provider is part of the scene. More... | |
void addViewProvider (ViewProvider *) | |
adds an ViewProvider to the view, e.g. from a feature More... | |
void removeViewProvider (ViewProvider *) | |
remove a ViewProvider More... | |
ViewProvider * getViewProviderByPath (SoPath *) const | |
get view provider by path More... | |
ViewProvider * getViewProviderByPathFromTail (SoPath *) const | |
std::vector< ViewProvider * > getViewProvidersOfType (const Base::Type &typeId) const | |
get all view providers of given type More... | |
void setEditingViewProvider (Gui::ViewProvider *p, int ModNum) | |
set the ViewProvider in special edit mode More... | |
SbBool isEditingViewProvider () const | |
return whether a view provider is edited More... | |
void resetEditingViewProvider () | |
reset from edit mode More... | |
void setupEditingRoot (SoNode *node=0, const Base::Matrix4D *mat=0) | |
void resetEditingRoot (bool updateLinks=true) | |
void setEditingTransform (const Base::Matrix4D &mat) | |
SoPickedPoint * getPointOnRay (const SbVec2s &pos, ViewProvider *vp) const | |
Helper method to get picked entities while editing. More... | |
SoPickedPoint * getPointOnRay (const SbVec3f &pos, const SbVec3f &dir, ViewProvider *vp) const | |
Helper method to get picked entities while editing. More... | |
void setOverrideMode (const std::string &mode) | |
display override mode More... | |
void updateOverrideMode (const std::string &mode) | |
update override mode. doesn't affect providers More... | |
std::string getOverrideMode () const | |
Making pictures | |
void savePicture (int w, int h, int s, const QColor &, QImage &) const | |
Creates an image with width w and height h of the current scene graph using a multi-sampling of s and exports the rendered scenegraph to an image. More... | |
void saveGraphic (int pagesize, const QColor &, SoVectorizeAction *va) const | |
bool dumpToFile (SoNode *node, const char *filename, bool binary) const | |
Writes the current scenegraph to an Inventor file, either in ascii or binary. More... | |
Selection methods | |
void startSelection (SelectionMode=Lasso) | |
void stopSelection () | |
bool isSelecting () const | |
std::vector< SbVec2f > getGLPolygon (SelectionRole *role=0) const | |
std::vector< SbVec2f > getGLPolygon (const std::vector< SbVec2s > &) const | |
const std::vector< SbVec2s > & getPolygon (SelectionRole *role=0) const | |
void setSelectionEnabled (const SbBool enable) | |
SbBool isSelectionEnabled (void) const | |
SbVec2f screenCoordsOfPath (SoPath *path) const | |
Returns the screen coordinates of the origin of the path's tail object. More... | |
Edit methods | |
void setEditing (SbBool edit) | |
SbBool isEditing () const | |
void setEditingCursor (const QCursor &cursor) | |
void setComponentCursor (const QCursor &cursor) | |
void setRedirectToSceneGraph (SbBool redirect) | |
SbBool isRedirectedToSceneGraph () const | |
void setRedirectToSceneGraphEnabled (SbBool enable) | |
SbBool isRedirectToSceneGraphEnabled (void) const | |
Pick actions | |
bool pickPoint (const SbVec2s &pos, SbVec3f &point, SbVec3f &norm) const | |
This method picks the closest point to the camera in the underlying scenegraph and returns its location and normal. More... | |
SoPickedPoint * pickPoint (const SbVec2s &pos) const | |
This method is provided for convenience and does basically the same as method above unless that it returns an SoPickedPoint object with additional information. More... | |
const SoPickedPoint * getPickedPoint (SoEventCallback *n) const | |
SbBool pubSeekToPoint (const SbVec2s &pos) | |
void pubSeekToPoint (const SbVec3f &pos) | |
void addEventCallback (SoType eventtype, SoEventCallbackCB *cb, void *userdata=0) | |
Set up a callback function cb which will be invoked for the given eventtype. More... | |
void removeEventCallback (SoType eventtype, SoEventCallbackCB *cb, void *userdata=0) | |
Unregister the given callback function cb. More... | |
Clipping plane, near and far plane | |
SbVec3f getViewDirection () const | |
Returns the view direction from the user's eye point in direction to the viewport which is actually the negative normal of the near plane. More... | |
void setViewDirection (SbVec3f) | |
SbVec3f getUpDirection () const | |
Returns the up direction. More... | |
SbRotation getCameraOrientation () const | |
Returns the orientation of the camera. More... | |
SbVec3f getPointOnScreen (const SbVec2s &) const | |
Returns the 3d point on the focal plane to the given 2d point. More... | |
void getNearPlane (SbVec3f &rcPt, SbVec3f &rcNormal) const | |
Returns the near plane represented by its normal and base point. More... | |
void getFarPlane (SbVec3f &rcPt, SbVec3f &rcNormal) const | |
Returns the far plane represented by its normal and base point. More... | |
void toggleClippingPlane (int toggle=-1, bool beforeEditing=false, bool noManip=false, const Base::Placement &pla=Base::Placement()) | |
Adds or remove a manipulator to/from the scenegraph. More... | |
bool hasClippingPlane () const | |
Checks whether a clipping plane is set or not. More... | |
SbVec3f projectOnNearPlane (const SbVec2f &) const | |
Project the given normalized 2d point onto the near plane. More... | |
SbVec3f projectOnFarPlane (const SbVec2f &) const | |
Project the given normalized 2d point onto the far plane. More... | |
![]() | |
void attachSelection () | |
Attaches to the selection. More... | |
bool blockConnection (bool block) | |
void detachSelection () | |
Detaches from the selection. More... | |
bool isConnectionAttached () const | |
bool isConnectionBlocked () const | |
SelectionObserver (bool attach=true, int resolve=1) | |
Constructor. More... | |
SelectionObserver (const Gui::ViewProviderDocumentObject *vp, bool attach=true, int resolve=1) | |
Constructor. More... | |
virtual ~SelectionObserver () | |
Render mode | |
enum RenderType { Native, Framebuffer, Image } | |
View3DInventorViewer (QWidget *parent, const QtGLWidget *sharewidget=0) | |
View3DInventorViewer (const QtGLFormat &format, QWidget *parent, const QtGLWidget *sharewidget=0) | |
virtual ~View3DInventorViewer () | |
void init () | |
virtual void onSelectionChanged (const SelectionChanges &Reason) | |
Observer message from the Selection. More... | |
void checkGroupOnTop (const SelectionChanges &Reason) | |
void clearGroupOnTop () | |
SoDirectionalLight * getBacklight (void) const | |
void setBacklight (SbBool on) | |
SbBool isBacklight (void) const | |
void setSceneGraph (SoNode *root) | |
SbBool searchNode (SoNode *) const | |
void setAnimationEnabled (const SbBool enable) | |
SbBool isAnimationEnabled (void) const | |
void setPopupMenuEnabled (const SbBool on) | |
SbBool isPopupMenuEnabled (void) const | |
void startAnimating (const SbVec3f &axis, float velocity) | |
void stopAnimating (void) | |
SbBool isAnimating (void) const | |
void setFeedbackVisibility (const SbBool enable) | |
SbBool isFeedbackVisible (void) const | |
void setFeedbackSize (const int size) | |
int getFeedbackSize (void) const | |
void setRenderType (const RenderType type) | |
RenderType getRenderType () const | |
void renderToFramebuffer (QtGLFramebufferObject *) | |
QImage grabFramebuffer () | |
void imageFromFramebuffer (int width, int height, int samples, const QColor &bgcolor, QImage &img) | |
virtual void setViewing (SbBool enable) | |
virtual void setCursorEnabled (SbBool enable) | |
void addGraphicsItem (GLGraphicsItem *) | |
void removeGraphicsItem (GLGraphicsItem *) | |
std::list< GLGraphicsItem * > getGraphicsItems () const | |
std::list< GLGraphicsItem * > getGraphicsItemsOfType (const Base::Type &) const | |
void clearGraphicsItems () | |
static int getNumSamples () | |
Get the preferred samples from the user settings. More... | |
Dimension controls | |
the "turn*" functions are wired up to parameter groups through view3dinventor. don't call them directly. instead set the parameter groups.
| |
enum eWinGestureTuneState { ewgtsDisabled, ewgtsNeedTuning, ewgtsTuned } | |
eWinGestureTuneState winGestureTuneState | |
class NavigationStyle | |
class GLPainter | |
class ViewerEventFilter | |
void turnAllDimensionsOn () | |
void turnAllDimensionsOff () | |
void turn3dDimensionsOn () | |
void turn3dDimensionsOff () | |
void turnDeltaDimensionsOn () | |
void turnDeltaDimensionsOff () | |
void eraseAllDimensions () | |
void addDimension3d (SoNode *node) | |
void addDimensionDelta (SoNode *node) | |
void setCameraOrientation (const SbRotation &rot, SbBool moveTocenter=false) | |
Set the camera's orientation. More... | |
void setCameraType (SoType t) | |
void moveCameraTo (const SbRotation &rot, const SbVec3f &pos, int steps, int ms) | |
void boxZoom (const SbBox2s &) | |
Zooms the viewport to the size of the bounding box. More... | |
void viewAll () | |
Reposition the current camera so we can see the complete scene. More... | |
void viewAll (float factor) | |
void viewVR (void) | |
Breaks out a VR window for a Rift. More... | |
void viewSelection () | |
Reposition the current camera so we can see all selected objects of the scene. More... | |
void setGradientBackground (bool b) | |
bool hasGradientBackground () const | |
void setGradientBackgroundColor (const SbColor &fromColor, const SbColor &toColor) | |
void setGradientBackgroundColor (const SbColor &fromColor, const SbColor &toColor, const SbColor &midColor) | |
void setNavigationType (Base::Type) | |
void setAxisCross (bool b) | |
bool hasAxisCross (void) | |
void setEnabledFPSCounter (bool b) | |
void setEnabledNaviCube (bool b) | |
bool isEnabledNaviCube (void) const | |
void setNaviCubeCorner (int) | |
NaviCube * getNavigationCube () const | |
void setEnabledVBO (bool b) | |
bool isEnabledVBO () const | |
void setRenderCache (int) | |
NavigationStyle * navigationStyle () const | |
void setDocument (Gui::Document *pcDocument) | |
Gui::Document * getDocument () | |
virtual PyObject * getPyObject (void) | |
GLenum getInternalTextureFormat () const | |
void renderScene () | |
void renderFramebuffer () | |
void renderGLImage () | |
void animatedViewAll (int steps, int ms) | |
virtual void actualRedraw (void) | |
virtual void setSeekMode (SbBool enable) | |
virtual void afterRealizeHook (void) | |
virtual bool processSoEvent (const SoEvent *ev) | |
void dropEvent (QDropEvent *e) | |
Drops the event e and loads the files into the given document. More... | |
void dragEnterEvent (QDragEnterEvent *e) | |
void dragMoveEvent (QDragMoveEvent *e) | |
void dragLeaveEvent (QDragLeaveEvent *e) | |
SbBool processSoEventBase (const SoEvent *const ev) | |
void printDimension () | |
void selectAll () | |
Detailed Description
GUI view into a 3D scene provided by View3DInventor.
Member Enumeration Documentation
◆ AntiAliasing
◆ eWinGestureTuneState
|
protected |
◆ RenderType
◆ SelectionMode
◆ ViewerMod
Constructor & Destructor Documentation
◆ View3DInventorViewer() [1/2]
View3DInventorViewer::View3DInventorViewer | ( | QWidget * | parent, |
const QtGLWidget * | sharewidget = 0 |
||
) |
References init().
◆ View3DInventorViewer() [2/2]
View3DInventorViewer::View3DInventorViewer | ( | const QtGLFormat & | format, |
QWidget * | parent, | ||
const QtGLWidget * | sharewidget = 0 |
||
) |
References init().
◆ ~View3DInventorViewer()
|
virtual |
Member Function Documentation
◆ actualRedraw()
|
protectedvirtual |
References Framebuffer, Image, Native, renderFramebuffer(), renderGLImage(), and renderScene().
◆ addDimension3d()
void View3DInventorViewer::addDimension3d | ( | SoNode * | node | ) |
◆ addDimensionDelta()
void View3DInventorViewer::addDimensionDelta | ( | SoNode * | node | ) |
◆ addEventCallback()
void View3DInventorViewer::addEventCallback | ( | SoType | eventtype, |
SoEventCallbackCB * | cb, | ||
void * | userdata = 0 |
||
) |
Set up a callback function cb which will be invoked for the given eventtype.
userdata will be given as the first argument to the callback function.
Referenced by MeshPartGui::CurveOnMeshHandler::enableCallback(), and setEditingViewProvider().
◆ addGraphicsItem()
void View3DInventorViewer::addGraphicsItem | ( | GLGraphicsItem * | item | ) |
◆ addViewProvider()
void View3DInventorViewer::addViewProvider | ( | ViewProvider * | pcProvider | ) |
adds an ViewProvider to the view, e.g. from a feature
References Gui::ViewProvider::canAddToSceneGraph(), Gui::ViewProvider::getBackRoot(), Gui::ViewProvider::getFrontRoot(), getOverrideMode(), Gui::ViewProvider::getRoot(), and Gui::ViewProvider::setOverrideMode().
Referenced by Gui::Document::cloneView(), Gui::Document::createView(), FemGui::DataMarker::DataMarker(), MeshPartGui::CurveOnMeshHandler::enableCallback(), Gui::PointMarker::PointMarker(), Gui::Document::setAnnotationViewProvider(), and Gui::Document::slotNewObject().
◆ afterRealizeHook()
|
protectedvirtual |
References Gui::NavigationStyle::getViewingMode().
◆ animatedViewAll()
|
protected |
Referenced by viewAll().
◆ boxZoom()
void View3DInventorViewer::boxZoom | ( | const SbBox2s & | box | ) |
Zooms the viewport to the size of the bounding box.
References Gui::NavigationStyle::boxZoom().
◆ checkGroupOnTop()
void View3DInventorViewer::checkGroupOnTop | ( | const SelectionChanges & | Reason | ) |
References Gui::SoSelectionElementAction::All, Gui::SoSelectionElementAction::Append, clearGroupOnTop(), Gui::SelectionChanges::ClrSelection, Gui::coinRemoveAllChildren(), Gui::SoFCUnifiedSelection::colorHighlight, Gui::SoFCUnifiedSelection::colorSelection, Gui::ViewProvider::getChildRoot(), Gui::Document::getDocument(), getDocument(), App::GeoFeatureGroupExtension::getGroupOfObject(), App::Document::getObject(), App::PropertyEnumeration::getValue(), Gui::Application::getViewProvider(), Gui::Application::Instance, Gui::SelectionSingleton::needPickedList(), Gui::ViewProviderDocumentObject::OnTopWhenSelected, Gui::SelectionChanges::pDocName, Gui::SelectionChanges::pObjectName, Gui::SelectionChanges::pSubName, Gui::SoSelectionElementAction::Remove, Gui::SelectionChanges::RmvPreselect, Gui::SelectionChanges::RmvPreselectSignal, Gui::SelectionChanges::RmvSelection, Gui::Selection(), Gui::SoFCPathAnnotation::setPath(), Gui::SelectionChanges::SetPreselect, Gui::SelectionChanges::SetSelection, and Gui::SelectionChanges::Type.
◆ clearGraphicsItems()
void View3DInventorViewer::clearGraphicsItems | ( | ) |
◆ clearGroupOnTop()
void View3DInventorViewer::clearGroupOnTop | ( | ) |
References Gui::coinRemoveAllChildren().
Referenced by checkGroupOnTop().
◆ containsViewProvider()
SbBool View3DInventorViewer::containsViewProvider | ( | const ViewProvider * | vp | ) | const |
Checks if the view provider is part of the scene.
In contrast to hasViewProvider() this method also checks if the view provider is a child of another view provider
References Gui::ViewProvider::getRoot().
◆ dragEnterEvent()
|
protected |
◆ dragLeaveEvent()
|
protected |
◆ dragMoveEvent()
|
protected |
◆ dropEvent()
|
protected |
Drops the event e and loads the files into the given document.
References Gui::Document::getDocument(), Gui::getMainWindow(), and Gui::MainWindow::loadUrls().
◆ dumpToFile()
Writes the current scenegraph to an Inventor file, either in ascii or binary.
References Base::FileInfo::hasExtension(), saveGraphic(), and Gui::SoFCDB::writeToFile().
◆ eraseAllDimensions()
void View3DInventorViewer::eraseAllDimensions | ( | ) |
References Gui::coinRemoveAllChildren().
◆ getBacklight()
SoDirectionalLight * View3DInventorViewer::getBacklight | ( | void | ) | const |
◆ getCameraOrientation()
SbRotation View3DInventorViewer::getCameraOrientation | ( | ) | const |
Returns the orientation of the camera.
◆ getDocument()
Document * View3DInventorViewer::getDocument | ( | ) |
◆ getFarPlane()
void View3DInventorViewer::getFarPlane | ( | SbVec3f & | rcPt, |
SbVec3f & | rcNormal | ||
) | const |
Returns the far plane represented by its normal and base point.
◆ getFeedbackSize()
int View3DInventorViewer::getFeedbackSize | ( | void | ) | const |
Return the size of the feedback axis cross. Default is 10.
◆ getGLPolygon() [1/2]
std::vector< SbVec2f > View3DInventorViewer::getGLPolygon | ( | const std::vector< SbVec2s > & | pnts | ) | const |
◆ getGLPolygon() [2/2]
std::vector< SbVec2f > View3DInventorViewer::getGLPolygon | ( | SelectionRole * | role = 0 | ) | const |
References Gui::NavigationStyle::getPolygon().
Referenced by PartGui::FaceColors::Private::selectionCallback().
◆ getGraphicsItems()
std::list< GLGraphicsItem * > View3DInventorViewer::getGraphicsItems | ( | ) | const |
◆ getGraphicsItemsOfType()
std::list< GLGraphicsItem * > View3DInventorViewer::getGraphicsItemsOfType | ( | const Base::Type & | type | ) | const |
◆ getInternalTextureFormat()
|
protected |
References App::GetApplication(), ParameterGrp::GetASCII(), and App::Application::GetParameterGroupByPath().
Referenced by grabFramebuffer(), imageFromFramebuffer(), and savePicture().
◆ getNavigationCube()
NaviCube * View3DInventorViewer::getNavigationCube | ( | ) | const |
◆ getNearPlane()
void View3DInventorViewer::getNearPlane | ( | SbVec3f & | rcPt, |
SbVec3f & | rcNormal | ||
) | const |
Returns the near plane represented by its normal and base point.
Referenced by MeshGui::ViewProviderMeshNode::handleEvent().
◆ getNumSamples()
|
static |
Get the preferred samples from the user settings.
References App::GetApplication(), ParameterGrp::GetInt(), App::Application::GetParameterGroupByPath(), MSAA2x, MSAA4x, MSAA8x, and Smoothing.
Referenced by Gui::AlignmentView::AlignmentView(), grabFramebuffer(), Gui::View3DInventorPy::saveImage(), setRenderType(), Gui::SplitView3DInventor::SplitView3DInventor(), and Gui::View3DInventor::View3DInventor().
◆ getOverrideMode()
std::string Gui::View3DInventorViewer::getOverrideMode | ( | ) | const |
Referenced by addViewProvider(), Gui::Document::cloneView(), and Gui::Document::createView().
◆ getPickedPoint()
const SoPickedPoint * View3DInventorViewer::getPickedPoint | ( | SoEventCallback * | n | ) | const |
◆ getPointOnRay() [1/2]
SoPickedPoint * View3DInventorViewer::getPointOnRay | ( | const SbVec2s & | pos, |
ViewProvider * | vp | ||
) | const |
Helper method to get picked entities while editing.
It's in the responsibility of the caller to delete the returned instance.
References Gui::ViewProvider::getRoot().
◆ getPointOnRay() [2/2]
SoPickedPoint * View3DInventorViewer::getPointOnRay | ( | const SbVec3f & | pos, |
const SbVec3f & | dir, | ||
ViewProvider * | vp | ||
) | const |
Helper method to get picked entities while editing.
It's in the responsibility of the caller to delete the returned instance.
References Gui::ViewProvider::getRoot().
◆ getPointOnScreen()
SbVec3f View3DInventorViewer::getPointOnScreen | ( | const SbVec2s & | pnt | ) | const |
Returns the 3d point on the focal plane to the given 2d point.
◆ getPolygon()
const std::vector< SbVec2s > & View3DInventorViewer::getPolygon | ( | SelectionRole * | role = 0 | ) | const |
References Gui::NavigationStyle::getPolygon().
◆ getPyObject()
|
virtual |
◆ getRenderType()
View3DInventorViewer::RenderType View3DInventorViewer::getRenderType | ( | ) | const |
◆ getUpDirection()
SbVec3f View3DInventorViewer::getUpDirection | ( | ) | const |
Returns the up direction.
◆ getViewDirection()
SbVec3f View3DInventorViewer::getViewDirection | ( | ) | const |
Returns the view direction from the user's eye point in direction to the viewport which is actually the negative normal of the near plane.
The vector is normalized to length of 1.
◆ getViewProviderByPath()
ViewProvider * View3DInventorViewer::getViewProviderByPath | ( | SoPath * | path | ) | const |
get view provider by path
◆ getViewProviderByPathFromTail()
ViewProvider * View3DInventorViewer::getViewProviderByPathFromTail | ( | SoPath * | path | ) | const |
◆ getViewProvidersOfType()
std::vector< ViewProvider * > View3DInventorViewer::getViewProvidersOfType | ( | const Base::Type & | typeId | ) | const |
get all view providers of given type
◆ grabFramebuffer()
QImage View3DInventorViewer::grabFramebuffer | ( | ) |
References getInternalTextureFormat(), getNumSamples(), and renderToFramebuffer().
Referenced by savePicture(), and setRenderType().
◆ hasAxisCross()
bool View3DInventorViewer::hasAxisCross | ( | void | ) |
Referenced by Gui::Document::cloneView().
◆ hasClippingPlane()
bool View3DInventorViewer::hasClippingPlane | ( | ) | const |
Checks whether a clipping plane is set or not.
◆ hasGradientBackground()
bool View3DInventorViewer::hasGradientBackground | ( | ) | const |
Referenced by imageFromFramebuffer().
◆ hasViewProvider()
SbBool View3DInventorViewer::hasViewProvider | ( | ViewProvider * | pcProvider | ) | const |
Checks if the view provider is a top-level object of the scene.
◆ imageFromFramebuffer()
void View3DInventorViewer::imageFromFramebuffer | ( | int | width, |
int | height, | ||
int | samples, | ||
const QColor & | bgcolor, | ||
QImage & | img | ||
) |
References Base::Console(), getInternalTextureFormat(), hasGradientBackground(), renderToFramebuffer(), setGradientBackground(), and Base::ConsoleSingleton::Warning().
Referenced by Gui::Thumbnail::SaveDocFile(), and savePicture().
◆ init()
void View3DInventorViewer::init | ( | ) |
References Gui::SelectionObserver::attachSelection(), Base::Console(), ewgtsDisabled, ewgtsNeedTuning, Gui::SoFCSelectionRoot::PassThrough, Gui::SoFCSelectionRoot::selectionStyle, setGradientBackground(), setRenderCache(), setSceneGraph(), setViewing(), ViewerEventFilter, Base::ConsoleSingleton::Warning(), and winGestureTuneState.
Referenced by DocumentObject.DocumentObject::onChanged(), and View3DInventorViewer().
◆ isAnimating()
SbBool View3DInventorViewer::isAnimating | ( | void | ) | const |
Query if the model in the viewer is currently in spinning mode after a user drag.
References Gui::NavigationStyle::isAnimating().
Referenced by renderScene(), and setSeekMode().
◆ isAnimationEnabled()
SbBool View3DInventorViewer::isAnimationEnabled | ( | void | ) | const |
Query whether or not it is possible to start a spinning animation by releasing the left mouse button while dragging the mouse.
References Gui::NavigationStyle::isAnimationEnabled().
Referenced by viewAll().
◆ isBacklight()
SbBool View3DInventorViewer::isBacklight | ( | void | ) | const |
◆ isEditing()
SbBool Gui::View3DInventorViewer::isEditing | ( | ) | const |
Referenced by Gui::GestureNavigationStyle::is2DViewing(), Gui::GestureNavigationStyle::processSoEvent(), Gui::InventorNavigationStyle::processSoEvent(), Gui::CADNavigationStyle::processSoEvent(), Gui::RevitNavigationStyle::processSoEvent(), Gui::BlenderNavigationStyle::processSoEvent(), Gui::MayaGestureNavigationStyle::processSoEvent(), Gui::TouchpadNavigationStyle::processSoEvent(), and Gui::OpenCascadeNavigationStyle::processSoEvent().
◆ isEditingViewProvider()
SbBool View3DInventorViewer::isEditingViewProvider | ( | ) | const |
return whether a view provider is edited
reset from edit mode
Referenced by Gui::Document::getInEdit().
◆ isEnabledNaviCube()
bool View3DInventorViewer::isEnabledNaviCube | ( | void | ) | const |
◆ isEnabledVBO()
bool View3DInventorViewer::isEnabledVBO | ( | ) | const |
◆ isFeedbackVisible()
SbBool View3DInventorViewer::isFeedbackVisible | ( | void | ) | const |
Check if the feedback axis cross is visible.
Referenced by setFeedbackSize().
◆ isPopupMenuEnabled()
SbBool View3DInventorViewer::isPopupMenuEnabled | ( | void | ) | const |
References Gui::NavigationStyle::isPopupMenuEnabled().
◆ isRedirectedToSceneGraph()
SbBool Gui::View3DInventorViewer::isRedirectedToSceneGraph | ( | ) | const |
Referenced by processSoEvent().
◆ isRedirectToSceneGraphEnabled()
SbBool Gui::View3DInventorViewer::isRedirectToSceneGraphEnabled | ( | void | ) | const |
◆ isSelecting()
bool View3DInventorViewer::isSelecting | ( | ) | const |
References Gui::NavigationStyle::isSelecting().
◆ isSelectionEnabled()
SbBool View3DInventorViewer::isSelectionEnabled | ( | void | ) | const |
◆ moveCameraTo()
void View3DInventorViewer::moveCameraTo | ( | const SbRotation & | rot, |
const SbVec3f & | pos, | ||
int | steps, | ||
int | ms | ||
) |
◆ navigationStyle()
NavigationStyle * View3DInventorViewer::navigationStyle | ( | ) | const |
◆ onSelectionChanged()
|
virtual |
Observer message from the Selection.
Implements Gui::SelectionObserver.
Referenced by setDocument().
◆ pickPoint() [1/2]
SoPickedPoint * View3DInventorViewer::pickPoint | ( | const SbVec2s & | pos | ) | const |
This method is provided for convenience and does basically the same as method above unless that it returns an SoPickedPoint object with additional information.
- Note
- It is in the response of the client programmer to delete the returned SoPickedPoint object.
◆ pickPoint() [2/2]
bool View3DInventorViewer::pickPoint | ( | const SbVec2s & | pos, |
SbVec3f & | point, | ||
SbVec3f & | norm | ||
) | const |
This method picks the closest point to the camera in the underlying scenegraph and returns its location and normal.
If no point was picked false is returned.
Referenced by PartGui::ViewProviderCurveNet::handleEvent().
◆ printDimension()
|
protected |
References Gui::getMainWindow(), Base::Quantity::MilliMetre, Base::UnitsApi::schemaTranslate(), Gui::MainWindow::setPaneText(), and Base::Quantity::setValue().
Referenced by renderFramebuffer(), renderGLImage(), and renderScene().
◆ processSoEvent()
◆ processSoEventBase()
|
protected |
Referenced by Gui::NavigationStyle::processSoEvent().
◆ projectOnFarPlane()
SbVec3f View3DInventorViewer::projectOnFarPlane | ( | const SbVec2f & | pt | ) | const |
Project the given normalized 2d point onto the far plane.
◆ projectOnNearPlane()
SbVec3f View3DInventorViewer::projectOnNearPlane | ( | const SbVec2f & | pt | ) | const |
Project the given normalized 2d point onto the near plane.
◆ pubSeekToPoint() [1/2]
SbBool View3DInventorViewer::pubSeekToPoint | ( | const SbVec2s & | pos | ) |
◆ pubSeekToPoint() [2/2]
void View3DInventorViewer::pubSeekToPoint | ( | const SbVec3f & | pos | ) |
◆ removeEventCallback()
void View3DInventorViewer::removeEventCallback | ( | SoType | eventtype, |
SoEventCallbackCB * | cb, | ||
void * | userdata = 0 |
||
) |
Unregister the given callback function cb.
Referenced by MeshPartGui::CurveOnMeshHandler::disableCallback(), resetEditingViewProvider(), PartGui::FaceColors::Private::selectionCallback(), and PartGui::FaceColors::~FaceColors().
◆ removeGraphicsItem()
void View3DInventorViewer::removeGraphicsItem | ( | GLGraphicsItem * | item | ) |
◆ removeViewProvider()
void View3DInventorViewer::removeViewProvider | ( | ViewProvider * | pcProvider | ) |
remove a ViewProvider
References Gui::ViewProvider::getBackRoot(), Gui::ViewProvider::getFrontRoot(), Gui::ViewProvider::getRoot(), and resetEditingViewProvider().
Referenced by Gui::Document::cloneView(), Gui::Document::createView(), MeshPartGui::CurveOnMeshHandler::disableCallback(), Gui::Document::removeAnnotationViewProvider(), Gui::Document::slotDeletedObject(), FemGui::DataMarker::~DataMarker(), and Gui::PointMarker::~PointMarker().
◆ renderFramebuffer()
|
protected |
References NaviCube::drawNaviCube(), printDimension(), and Gui::NavigationStyle::redraw().
Referenced by actualRedraw().
◆ renderGLImage()
|
protected |
References NaviCube::drawNaviCube(), printDimension(), and Gui::NavigationStyle::redraw().
Referenced by actualRedraw().
◆ renderScene()
|
protected |
◆ renderToFramebuffer()
void View3DInventorViewer::renderToFramebuffer | ( | QtGLFramebufferObject * | fbo | ) |
References Gui::SoBoxSelectionRenderAction::apply().
Referenced by grabFramebuffer(), imageFromFramebuffer(), and setRenderType().
◆ resetEditingRoot()
void View3DInventorViewer::resetEditingRoot | ( | bool | updateLinks = true | ) |
References Gui::ViewProvider::getRoot(), Gui::ViewProvider::getTransformNode(), and Gui::ViewProviderLink::updateLinks().
Referenced by resetEditingViewProvider(), setupEditingRoot(), and ~View3DInventorViewer().
◆ resetEditingViewProvider()
void View3DInventorViewer::resetEditingViewProvider | ( | ) |
reset from edit mode
References Gui::ViewProvider::eventCallback(), removeEventCallback(), resetEditingRoot(), and Gui::ViewProvider::unsetEditViewer().
Referenced by Gui::Document::cloneView(), and removeViewProvider().
◆ saveGraphic()
void View3DInventorViewer::saveGraphic | ( | int | pagesize, |
const QColor & | bgcolor, | ||
SoVectorizeAction * | va | ||
) | const |
Referenced by dumpToFile().
◆ savePicture()
void View3DInventorViewer::savePicture | ( | int | w, |
int | h, | ||
int | s, | ||
const QColor & | bg, | ||
QImage & | img | ||
) | const |
Creates an image with width w and height h of the current scene graph using a multi-sampling of s and exports the rendered scenegraph to an image.
References App::GetApplication(), ParameterGrp::GetASCII(), getInternalTextureFormat(), App::Application::GetParameterGroupByPath(), grabFramebuffer(), imageFromFramebuffer(), Gui::SoFCOffscreenRenderer::instance(), Gui::SoQtOffscreenRenderer::render(), Gui::SoQtOffscreenRenderer::setBackgroundColor(), Gui::SoQtOffscreenRenderer::setInternalTextureFormat(), Gui::SoQtOffscreenRenderer::setNumPasses(), Gui::SoQtOffscreenRenderer::setPbufferEnable(), Gui::SoFCOffscreenRenderer::writeToImage(), and Gui::SoQtOffscreenRenderer::writeToImage().
◆ screenCoordsOfPath()
SbVec2f View3DInventorViewer::screenCoordsOfPath | ( | SoPath * | path | ) | const |
Returns the screen coordinates of the origin of the path's tail object.
Return value is in floating-point pixels, origin at bottom-left.
◆ searchNode()
SbBool View3DInventorViewer::searchNode | ( | SoNode * | node | ) | const |
◆ selectAll()
|
protected |
◆ setAnimationEnabled()
void View3DInventorViewer::setAnimationEnabled | ( | const SbBool | enable | ) |
Decide if it should be possible to start a spin animation of the model in the viewer by releasing the mouse button while dragging.
If the enable flag is false
and we're currently animating, the spin will be stopped.
References Gui::NavigationStyle::setAnimationEnabled().
◆ setAxisCross()
void View3DInventorViewer::setAxisCross | ( | bool | b | ) |
References Gui::SoShapeScale::scaleFactor.
Referenced by Gui::Document::cloneView().
◆ setBacklight()
void View3DInventorViewer::setBacklight | ( | SbBool | on | ) |
◆ setCameraOrientation()
void View3DInventorViewer::setCameraOrientation | ( | const SbRotation & | rot, |
SbBool | moveTocenter = false |
||
) |
Set the camera's orientation.
If isAnimationEnabled() returns true the reorientation is animated, otherwise its directly set.
References Gui::NavigationStyle::setCameraOrientation().
◆ setCameraType()
void View3DInventorViewer::setCameraType | ( | SoType | t | ) |
Referenced by TechDrawGui::Grabber3d::copyActiveViewToSvgFile().
◆ setComponentCursor()
void View3DInventorViewer::setComponentCursor | ( | const QCursor & | cursor | ) |
◆ setCursorEnabled()
|
virtual |
Decide whether or not the mouse pointer cursor should be visible in the rendering canvas.
References Gui::NavigationStyle::getViewingMode().
◆ setDocument()
void View3DInventorViewer::setDocument | ( | Gui::Document * | pcDocument | ) |
◆ setEditing()
void View3DInventorViewer::setEditing | ( | SbBool | edit | ) |
◆ setEditingCursor()
void View3DInventorViewer::setEditingCursor | ( | const QCursor & | cursor | ) |
Referenced by MeshPartGui::CurveOnMeshHandler::enableCallback().
◆ setEditingTransform()
void View3DInventorViewer::setEditingTransform | ( | const Base::Matrix4D & | mat | ) |
References Base::Matrix4D::getGLMatrix().
Referenced by Gui::Document::setEditingTransform(), and setupEditingRoot().
◆ setEditingViewProvider()
void View3DInventorViewer::setEditingViewProvider | ( | Gui::ViewProvider * | p, |
int | ModNum | ||
) |
set the ViewProvider in special edit mode
References addEventCallback(), Gui::ViewProvider::eventCallback(), and Gui::ViewProvider::setEditViewer().
Referenced by Gui::Document::cloneView(), and Gui::Document::setEdit().
◆ setEnabledFPSCounter()
void View3DInventorViewer::setEnabledFPSCounter | ( | bool | b | ) |
◆ setEnabledNaviCube()
void View3DInventorViewer::setEnabledNaviCube | ( | bool | b | ) |
◆ setEnabledVBO()
void View3DInventorViewer::setEnabledVBO | ( | bool | b | ) |
◆ setFeedbackSize()
void View3DInventorViewer::setFeedbackSize | ( | const int | size | ) |
Set the size of the feedback axiscross. The value is interpreted as an approximate percentage chunk of the dimensions of the total canvas.
References isFeedbackVisible().
◆ setFeedbackVisibility()
void View3DInventorViewer::setFeedbackVisibility | ( | const SbBool | enable | ) |
Set the flag deciding whether or not to show the axis cross.
◆ setGradientBackground()
void View3DInventorViewer::setGradientBackground | ( | bool | b | ) |
Referenced by imageFromFramebuffer(), and init().
◆ setGradientBackgroundColor() [1/2]
void View3DInventorViewer::setGradientBackgroundColor | ( | const SbColor & | fromColor, |
const SbColor & | toColor | ||
) |
References Gui::SoFCBackgroundGradient::setColorGradient().
◆ setGradientBackgroundColor() [2/2]
void View3DInventorViewer::setGradientBackgroundColor | ( | const SbColor & | fromColor, |
const SbColor & | toColor, | ||
const SbColor & | midColor | ||
) |
References Gui::SoFCBackgroundGradient::setColorGradient().
◆ setNaviCubeCorner()
void View3DInventorViewer::setNaviCubeCorner | ( | int | c | ) |
References NaviCube::setCorner().
◆ setNavigationType()
void View3DInventorViewer::setNavigationType | ( | Base::Type | t | ) |
◆ setOverrideMode()
void View3DInventorViewer::setOverrideMode | ( | const std::string & | mode | ) |
display override mode
References Base::Persistence::getClassTypeId(), getDocument(), and Gui::Document::getViewProvidersOfType().
Referenced by Gui::Document::cloneView(), and Gui::Document::createView().
◆ setPopupMenuEnabled()
void View3DInventorViewer::setPopupMenuEnabled | ( | const SbBool | on | ) |
References Gui::NavigationStyle::setPopupMenuEnabled().
◆ setRedirectToSceneGraph()
void Gui::View3DInventorViewer::setRedirectToSceneGraph | ( | SbBool | redirect | ) |
◆ setRedirectToSceneGraphEnabled()
void Gui::View3DInventorViewer::setRedirectToSceneGraphEnabled | ( | SbBool | enable | ) |
◆ setRenderCache()
void View3DInventorViewer::setRenderCache | ( | int | mode | ) |
References App::GetApplication(), ParameterGrp::GetInt(), App::Application::GetParameterGroupByPath(), and Gui::SoFCSeparator::setCacheMode().
Referenced by init().
◆ setRenderType()
void View3DInventorViewer::setRenderType | ( | const RenderType | type | ) |
References Framebuffer, getNumSamples(), grabFramebuffer(), Image, Native, and renderToFramebuffer().
◆ setSceneGraph()
void View3DInventorViewer::setSceneGraph | ( | SoNode * | root | ) |
Referenced by TechDrawGui::Grabber3d::copyActiveViewToSvgFile(), init(), and ~View3DInventorViewer().
◆ setSeekMode()
|
protectedvirtual |
◆ setSelectionEnabled()
void View3DInventorViewer::setSelectionEnabled | ( | const SbBool | enable | ) |
◆ setupEditingRoot()
void View3DInventorViewer::setupEditingRoot | ( | SoNode * | node = 0 , |
const Base::Matrix4D * | mat = 0 |
||
) |
◆ setViewDirection()
void View3DInventorViewer::setViewDirection | ( | SbVec3f | dir | ) |
◆ setViewing()
|
virtual |
References Gui::NavigationStyle::IDLE, Gui::NavigationStyle::INTERACT, and Gui::NavigationStyle::setViewingMode().
Referenced by init(), and Gui::NavigationStyle::setViewing().
◆ startAnimating()
void View3DInventorViewer::startAnimating | ( | const SbVec3f & | axis, |
float | velocity | ||
) |
Starts programmatically the viewer in animation mode. The given axis direction is always in screen coordinates, not in world coordinates.
References Gui::NavigationStyle::startAnimating().
◆ startSelection()
void View3DInventorViewer::startSelection | ( | View3DInventorViewer::SelectionMode | mode = Lasso | ) |
References Gui::NavigationStyle::startSelection().
◆ stopAnimating()
void View3DInventorViewer::stopAnimating | ( | void | ) |
References Gui::NavigationStyle::stopAnimating().
Referenced by setSeekMode().
◆ stopSelection()
void View3DInventorViewer::stopSelection | ( | ) |
References Gui::NavigationStyle::stopSelection().
Referenced by PartGui::FaceColors::~FaceColors().
◆ toggleClippingPlane()
void View3DInventorViewer::toggleClippingPlane | ( | int | toggle = -1 , |
bool | beforeEditing = false , |
||
bool | noManip = false , |
||
const Base::Placement & | pla = Base::Placement() |
||
) |
Adds or remove a manipulator to/from the scenegraph.
References Base::Placement::getPosition(), Base::Placement::getRotation(), Base::Rotation::multVec(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
◆ turn3dDimensionsOff()
void View3DInventorViewer::turn3dDimensionsOff | ( | ) |
◆ turn3dDimensionsOn()
void View3DInventorViewer::turn3dDimensionsOn | ( | ) |
◆ turnAllDimensionsOff()
void View3DInventorViewer::turnAllDimensionsOff | ( | ) |
◆ turnAllDimensionsOn()
void View3DInventorViewer::turnAllDimensionsOn | ( | ) |
◆ turnDeltaDimensionsOff()
void View3DInventorViewer::turnDeltaDimensionsOff | ( | ) |
◆ turnDeltaDimensionsOn()
void View3DInventorViewer::turnDeltaDimensionsOn | ( | ) |
◆ updateOverrideMode()
void View3DInventorViewer::updateOverrideMode | ( | const std::string & | mode | ) |
update override mode. doesn't affect providers
◆ viewAll() [1/2]
void View3DInventorViewer::viewAll | ( | ) |
Reposition the current camera so we can see the complete scene.
References animatedViewAll(), Gui::SoSkipBoundingGroup::EXCLUDE_BBOX, Gui::SoSkipBoundingGroup::INCLUDE_BBOX, isAnimationEnabled(), and Gui::SoSkipBoundingGroup::mode.
Referenced by viewAll().
◆ viewAll() [2/2]
void View3DInventorViewer::viewAll | ( | float | factor | ) |
◆ viewSelection()
void View3DInventorViewer::viewSelection | ( | ) |
Reposition the current camera so we can see all selected objects of the scene.
Therefore we search for all SOFCSelection nodes, if none of them is selected nothing happens.
References Base::BoundBox3< _Precision >::Add(), Gui::Application::getViewProvider(), Gui::Application::Instance, Base::BoundBox3< _Precision >::IsValid(), Base::BoundBox3< _Precision >::MaxX, Base::BoundBox3< _Precision >::MaxY, Base::BoundBox3< _Precision >::MaxZ, Base::BoundBox3< _Precision >::MinX, Base::BoundBox3< _Precision >::MinY, Base::BoundBox3< _Precision >::MinZ, and Gui::Selection().
◆ viewVR()
void View3DInventorViewer::viewVR | ( | void | ) |
Breaks out a VR window for a Rift.
Friends And Related Function Documentation
◆ GLPainter
◆ NavigationStyle
|
friend |
◆ ViewerEventFilter
|
friend |
Referenced by init().
Member Data Documentation
◆ winGestureTuneState
|
protected |
Referenced by init(), and setNavigationType().
The documentation for this class was generated from the following files:
- src/Gui/View3DInventorViewer.h
- src/Gui/View3DInventorViewer.cpp