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 { } |
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=nullptr, const Base::Matrix4D *mat=nullptr) |
void | resetEditingRoot (bool updateLinks=true) |
void | setEditingTransform (const Base::Matrix4D &mat) |
SoPickedPoint * | getPointOnRay (const SbVec2s &pos, const ViewProvider *vp) const |
Helper method to get picked entities while editing. More... | |
SoPickedPoint * | getPointOnRay (const SbVec3f &pos, const SbVec3f &dir, const 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 | abortSelection () |
void | stopSelection () |
bool | isSelecting () const |
std::vector< SbVec2f > | getGLPolygon (SelectionRole *role=nullptr) const |
std::vector< SbVec2f > | getGLPolygon (const std::vector< SbVec2s > &) const |
const std::vector< SbVec2s > & | getPolygon (SelectionRole *role=nullptr) 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=nullptr) |
Set up a callback function cb which will be invoked for the given eventtype. More... | |
void | removeEventCallback (SoType eventtype, SoEventCallbackCB *cb, void *userdata=nullptr) |
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 | getPointOnFocalPlane (const SbVec2s &) const |
Returns the 3d point on the focal plane to the given 2d point. More... | |
SbVec2s | getPointOnScreen (const SbVec3f &) const |
Returns the 2d coordinates on the screen to the given 3d 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 | projectPointToLine (const SbVec2s &, SbVec3f &pt1, SbVec3f &pt2) const |
Project the given 2d point to a line. More... | |
SbVec2f | getNormalizedPosition (const SbVec2s &) const |
Get the normalized position of the 2d point. More... | |
Public Member Functions inherited from Gui::SelectionObserver | |
void | attachSelection () |
Attaches to the selection. More... | |
bool | blockSelection (bool block) |
void | detachSelection () |
Detaches from the selection. More... | |
bool | isSelectionAttached () const |
bool | isSelectionBlocked () const |
SelectionObserver (bool attach=true, ResolveMode resolve=ResolveMode::OldStyleElement) | |
Constructor. More... | |
SelectionObserver (const Gui::ViewProviderDocumentObject *vp, bool attach=true, ResolveMode resolve=ResolveMode::OldStyleElement) | |
Constructor. More... | |
virtual | ~SelectionObserver () |
Render mode | |
enum | RenderType { Native , Framebuffer , Image } |
View3DInventorViewer (QWidget *parent, const QtGLWidget *sharewidget=nullptr) | |
View3DInventorViewer (const QtGLFormat &format, QWidget *parent, const QtGLWidget *sharewidget=nullptr) | |
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.
| |
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... | |
SbBox3f | getBoundingBox () const |
Returns the bounding box of the scene graph. 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 () |
GUI view into a 3D scene provided by View3DInventor.
View3DInventorViewer::View3DInventorViewer | ( | QWidget * | parent, |
const QtGLWidget * | sharewidget = nullptr |
||
) |
References init(), and Gui::NoResolve.
View3DInventorViewer::View3DInventorViewer | ( | const QtGLFormat & | format, |
QWidget * | parent, | ||
const QtGLWidget * | sharewidget = nullptr |
||
) |
References init(), and Gui::NoResolve.
|
virtual |
void View3DInventorViewer::abortSelection | ( | ) |
References Gui::NavigationStyle::abortSelection(), and setCursorEnabled().
|
protectedvirtual |
References Framebuffer, Image, Native, renderFramebuffer(), renderGLImage(), and renderScene().
void View3DInventorViewer::addDimension3d | ( | SoNode * | node | ) |
void View3DInventorViewer::addDimensionDelta | ( | SoNode * | node | ) |
void View3DInventorViewer::addEventCallback | ( | SoType | eventtype, |
SoEventCallbackCB * | cb, | ||
void * | userdata = nullptr |
||
) |
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 Gui::View3DInventorPy::addEventCallback(), Gui::View3DInventorPy::addEventCallbackPivy(), MeshPartGui::CurveOnMeshHandler::enableCallback(), and setEditingViewProvider().
void View3DInventorViewer::addGraphicsItem | ( | GLGraphicsItem * | item | ) |
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().
|
protectedvirtual |
References Gui::NavigationStyle::getViewingMode().
References draftgeoutils.intersections::connect(), and getBoundingBox().
Referenced by viewAll().
void View3DInventorViewer::boxZoom | ( | const SbBox2s & | box | ) |
Zooms the viewport to the size of the bounding box.
References Gui::NavigationStyle::boxZoom().
Referenced by Gui::View3DInventorPy::boxZoom().
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(), getDocument(), Gui::Document::getDocument(), App::GeoFeatureGroupExtension::getGroupOfObject(), App::Document::getObject(), Gui::Application::getViewProvider(), Gui::Application::Instance, Gui::SelectionSingleton::needPickedList(), 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.
void View3DInventorViewer::clearGraphicsItems | ( | ) |
void View3DInventorViewer::clearGroupOnTop | ( | ) |
References Gui::coinRemoveAllChildren().
Referenced by checkGroupOnTop().
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().
|
protected |
|
protected |
|
protected |
|
protected |
Drops the event e and loads the files into the given document.
References Gui::Document::getDocument(), Gui::getMainWindow(), and Gui::MainWindow::loadUrls().
Writes the current scenegraph to an Inventor file, either in ascii or binary.
References Base::FileInfo::hasExtension(), saveGraphic(), and Gui::SoFCDB::writeToFile().
void View3DInventorViewer::eraseAllDimensions | ( | ) |
References Gui::coinRemoveAllChildren().
SoDirectionalLight * View3DInventorViewer::getBacklight | ( | void | ) | const |
SbBox3f View3DInventorViewer::getBoundingBox | ( | ) | const |
Returns the bounding box of the scene graph.
Referenced by animatedViewAll(), toggleClippingPlane(), and viewAll().
SbRotation View3DInventorViewer::getCameraOrientation | ( | ) | const |
Returns the orientation of the camera.
Referenced by Gui::View3DInventorPy::getCameraOrientation().
Document * View3DInventorViewer::getDocument | ( | void | ) |
void View3DInventorViewer::getFarPlane | ( | SbVec3f & | rcPt, |
SbVec3f & | rcNormal | ||
) | const |
Returns the far plane represented by its normal and base point.
int View3DInventorViewer::getFeedbackSize | ( | void | ) | const |
Return the size of the feedback axis cross. Default is 10.
Referenced by Gui::View3DInventorPy::getCornerCrossSize().
std::vector< SbVec2f > View3DInventorViewer::getGLPolygon | ( | const std::vector< SbVec2s > & | pnts | ) | const |
std::vector< SbVec2f > View3DInventorViewer::getGLPolygon | ( | SelectionRole * | role = nullptr | ) | const |
References getGLPolygon(), and Gui::NavigationStyle::getPolygon().
Referenced by getGLPolygon().
std::list< GLGraphicsItem * > View3DInventorViewer::getGraphicsItems | ( | ) | const |
std::list< GLGraphicsItem * > View3DInventorViewer::getGraphicsItemsOfType | ( | const Base::Type & | type | ) | const |
|
protected |
References App::GetApplication(), ParameterGrp::GetASCII(), and App::Application::GetParameterGroupByPath().
Referenced by grabFramebuffer(), imageFromFramebuffer(), and savePicture().
NaviCube * View3DInventorViewer::getNavigationCube | ( | ) | const |
void View3DInventorViewer::getNearPlane | ( | SbVec3f & | rcPt, |
SbVec3f & | rcNormal | ||
) | const |
Returns the near plane represented by its normal and base point.
Referenced by MeshGui::ViewProviderMeshNode::handleEvent().
SbVec2f View3DInventorViewer::getNormalizedPosition | ( | const SbVec2s & | pnt | ) | const |
Get the normalized position of the 2d point.
Referenced by getPointOnFocalPlane(), and projectPointToLine().
|
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().
std::string Gui::View3DInventorViewer::getOverrideMode | ( | ) | const |
Referenced by addViewProvider(), Gui::Document::cloneView(), and Gui::Document::createView().
const SoPickedPoint * View3DInventorViewer::getPickedPoint | ( | SoEventCallback * | n | ) | const |
SbVec3f View3DInventorViewer::getPointOnFocalPlane | ( | const SbVec2s & | pnt | ) | const |
Returns the 3d point on the focal plane to the given 2d point.
References getNormalizedPosition().
Referenced by Gui::View3DInventorPy::getPointOnFocalPlane().
SoPickedPoint * View3DInventorViewer::getPointOnRay | ( | const SbVec2s & | pos, |
const 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().
SoPickedPoint * View3DInventorViewer::getPointOnRay | ( | const SbVec3f & | pos, |
const SbVec3f & | dir, | ||
const 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().
SbVec2s View3DInventorViewer::getPointOnScreen | ( | const SbVec3f & | pnt | ) | const |
Returns the 2d coordinates on the screen to the given 3d point.
Referenced by Gui::View3DInventorPy::getPointOnScreen().
const std::vector< SbVec2s > & View3DInventorViewer::getPolygon | ( | SelectionRole * | role = nullptr | ) | const |
References Gui::NavigationStyle::getPolygon().
|
virtual |
View3DInventorViewer::RenderType View3DInventorViewer::getRenderType | ( | ) | const |
SbVec3f View3DInventorViewer::getUpDirection | ( | ) | const |
Returns the up direction.
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.
Referenced by Gui::View3DInventorPy::getViewDirection().
ViewProvider * View3DInventorViewer::getViewProviderByPath | ( | SoPath * | path | ) | const |
get view provider by path
Referenced by Gui::View3DInventorPy::getObjectInfo(), and Gui::View3DInventorPy::getObjectsInfo().
ViewProvider * View3DInventorViewer::getViewProviderByPathFromTail | ( | SoPath * | path | ) | const |
std::vector< ViewProvider * > View3DInventorViewer::getViewProvidersOfType | ( | const Base::Type & | typeId | ) | const |
get all view providers of given type
Referenced by Gui::View3DInventorPy::getViewProvidersOfType().
QImage View3DInventorViewer::grabFramebuffer | ( | ) |
References getInternalTextureFormat(), getNumSamples(), and renderToFramebuffer().
Referenced by savePicture(), and setRenderType().
bool View3DInventorViewer::hasAxisCross | ( | void | ) |
Referenced by Gui::Document::cloneView(), and Gui::View3DInventorPy::hasAxisCross().
bool View3DInventorViewer::hasClippingPlane | ( | ) | const |
Checks whether a clipping plane is set or not.
bool View3DInventorViewer::hasGradientBackground | ( | ) | const |
Referenced by imageFromFramebuffer().
SbBool View3DInventorViewer::hasViewProvider | ( | ViewProvider * | pcProvider | ) | const |
Checks if the view provider is a top-level object of the scene.
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().
void View3DInventorViewer::init | ( | void | ) |
References Gui::SelectionObserver::attachSelection(), draftgeoutils.intersections::connect(), Base::Console(), Gui::SoFCSelectionRoot::PassThrough, Gui::SoFCSelectionRoot::selectionStyle, setGradientBackground(), setRenderCache(), setSceneGraph(), setViewing(), ViewerEventFilter, and Base::ConsoleSingleton::Warning().
Referenced by DocumentObject.DocumentObject::onChanged(), and View3DInventorViewer().
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().
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 Gui::View3DInventorPy::isAnimationEnabled(), and viewAll().
SbBool View3DInventorViewer::isBacklight | ( | void | ) | const |
SbBool Gui::View3DInventorViewer::isEditing | ( | ) | const |
Referenced by Gui::GestureNavigationStyle::is2DViewing(), Gui::InventorNavigationStyle::processSoEvent(), Gui::CADNavigationStyle::processSoEvent(), Gui::RevitNavigationStyle::processSoEvent(), Gui::BlenderNavigationStyle::processSoEvent(), Gui::MayaGestureNavigationStyle::processSoEvent(), Gui::TouchpadNavigationStyle::processSoEvent(), Gui::OpenCascadeNavigationStyle::processSoEvent(), Gui::OpenSCADNavigationStyle::processSoEvent(), Gui::TinkerCADNavigationStyle::processSoEvent(), and Gui::GestureNavigationStyle::processSoEvent().
SbBool View3DInventorViewer::isEditingViewProvider | ( | ) | const |
return whether a view provider is edited
reset from edit mode
Referenced by Gui::Document::getInEdit().
bool View3DInventorViewer::isEnabledNaviCube | ( | void | ) | const |
bool View3DInventorViewer::isEnabledVBO | ( | ) | const |
SbBool View3DInventorViewer::isFeedbackVisible | ( | void | ) | const |
Check if the feedback axis cross is visible.
Referenced by Gui::View3DInventorPy::isCornerCrossVisible(), and setFeedbackSize().
SbBool View3DInventorViewer::isPopupMenuEnabled | ( | void | ) | const |
References Gui::NavigationStyle::isPopupMenuEnabled().
Referenced by Gui::View3DInventorPy::isPopupMenuEnabled().
SbBool Gui::View3DInventorViewer::isRedirectedToSceneGraph | ( | ) | const |
Referenced by processSoEvent().
SbBool Gui::View3DInventorViewer::isRedirectToSceneGraphEnabled | ( | void | ) | const |
bool View3DInventorViewer::isSelecting | ( | ) | const |
References Gui::NavigationStyle::isSelecting().
SbBool View3DInventorViewer::isSelectionEnabled | ( | void | ) | const |
Referenced by Gui::PointMarker::PointMarker().
void View3DInventorViewer::moveCameraTo | ( | const SbRotation & | rot, |
const SbVec3f & | pos, | ||
int | steps, | ||
int | ms | ||
) |
References draftgeoutils.intersections::connect().
Referenced by Gui::View3DInventorPy::viewPosition().
NavigationStyle * View3DInventorViewer::navigationStyle | ( | ) | const |
|
virtual |
Observer message from the Selection.
Implements Gui::SelectionObserver.
Referenced by setDocument().
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.
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().
|
protected |
References Gui::getMainWindow(), Base::Quantity::MilliMetre, Base::UnitsApi::schemaTranslate(), Gui::MainWindow::setPaneText(), and Base::Quantity::setValue().
Referenced by renderFramebuffer(), renderGLImage(), and renderScene().
|
protected |
Referenced by Gui::NavigationStyle::processSoEvent().
SbVec3f View3DInventorViewer::projectOnFarPlane | ( | const SbVec2f & | pt | ) | const |
Project the given normalized 2d point onto the far plane.
SbVec3f View3DInventorViewer::projectOnNearPlane | ( | const SbVec2f & | pt | ) | const |
Project the given normalized 2d point onto the near plane.
void View3DInventorViewer::projectPointToLine | ( | const SbVec2s & | pt, |
SbVec3f & | pt1, | ||
SbVec3f & | pt2 | ||
) | const |
Project the given 2d point to a line.
References getNormalizedPosition().
Referenced by Gui::View3DInventorPy::projectPointToLine(), and Gui::NavigationStyle::viewAll().
SbBool View3DInventorViewer::pubSeekToPoint | ( | const SbVec2s & | pos | ) |
void View3DInventorViewer::pubSeekToPoint | ( | const SbVec3f & | pos | ) |
void View3DInventorViewer::removeEventCallback | ( | SoType | eventtype, |
SoEventCallbackCB * | cb, | ||
void * | userdata = nullptr |
||
) |
Unregister the given callback function cb.
Referenced by MeshPartGui::CurveOnMeshHandler::disableCallback(), Gui::View3DInventorPy::removeEventCallback(), Gui::View3DInventorPy::removeEventCallbackPivy(), and resetEditingViewProvider().
void View3DInventorViewer::removeGraphicsItem | ( | GLGraphicsItem * | item | ) |
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().
|
protected |
References NaviCube::drawNaviCube(), printDimension(), and Gui::NavigationStyle::redraw().
Referenced by actualRedraw().
|
protected |
References NaviCube::drawNaviCube(), printDimension(), and Gui::NavigationStyle::redraw().
Referenced by actualRedraw().
|
protected |
void View3DInventorViewer::renderToFramebuffer | ( | QtGLFramebufferObject * | fbo | ) |
References Gui::SoBoxSelectionRenderAction::apply().
Referenced by grabFramebuffer(), imageFromFramebuffer(), and setRenderType().
void View3DInventorViewer::resetEditingRoot | ( | bool | updateLinks = true | ) |
void View3DInventorViewer::resetEditingViewProvider | ( | ) |
reset from edit mode
References Gui::ViewProvider::eventCallback(), removeEventCallback(), resetEditingRoot(), and Gui::ViewProvider::unsetEditViewer().
Referenced by Gui::Document::cloneView(), and removeViewProvider().
void View3DInventorViewer::saveGraphic | ( | int | pagesize, |
const QColor & | bgcolor, | ||
SoVectorizeAction * | va | ||
) | const |
Referenced by dumpToFile(), and Gui::View3DInventorPy::saveVectorGraphic().
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::SoFCOffscreenRenderer::writeToImage(), and Gui::SoQtOffscreenRenderer::writeToImage().
Referenced by Gui::View3DInventorPy::saveImage().
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.
SbBool View3DInventorViewer::searchNode | ( | SoNode * | node | ) | const |
|
protected |
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().
Referenced by Gui::View3DInventorPy::setAnimationEnabled().
void View3DInventorViewer::setAxisCross | ( | bool | b | ) |
References Gui::SoShapeScale::scaleFactor.
Referenced by Gui::Document::cloneView(), and Gui::View3DInventorPy::setAxisCross().
void View3DInventorViewer::setBacklight | ( | SbBool | on | ) |
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().
Referenced by Gui::View3DInventorPy::setCameraOrientation(), Gui::View3DInventorPy::viewBottom(), Gui::View3DInventorPy::viewDimetric(), Gui::View3DInventorPy::viewFront(), Gui::View3DInventorPy::viewIsometric(), Gui::View3DInventorPy::viewLeft(), Gui::View3DInventorPy::viewRear(), Gui::View3DInventorPy::viewRight(), Gui::View3DInventorPy::viewTop(), and Gui::View3DInventorPy::viewTrimetric().
void View3DInventorViewer::setCameraType | ( | SoType | t | ) |
void View3DInventorViewer::setComponentCursor | ( | const QCursor & | cursor | ) |
|
virtual |
Decide whether or not the mouse pointer cursor should be visible in the rendering canvas.
References Gui::NavigationStyle::getViewingMode().
Referenced by abortSelection(), and stopSelection().
void View3DInventorViewer::setDocument | ( | Gui::Document * | pcDocument | ) |
void View3DInventorViewer::setEditing | ( | SbBool | edit | ) |
void View3DInventorViewer::setEditingCursor | ( | const QCursor & | cursor | ) |
Referenced by MeshPartGui::CurveOnMeshHandler::enableCallback().
void View3DInventorViewer::setEditingTransform | ( | const Base::Matrix4D & | mat | ) |
References Base::Matrix4D::getGLMatrix().
Referenced by Gui::Document::setEditingTransform(), and setupEditingRoot().
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().
void View3DInventorViewer::setEnabledFPSCounter | ( | bool | b | ) |
void View3DInventorViewer::setEnabledNaviCube | ( | bool | b | ) |
void View3DInventorViewer::setEnabledVBO | ( | bool | b | ) |
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().
Referenced by Gui::View3DInventorPy::setCornerCrossSize().
void View3DInventorViewer::setFeedbackVisibility | ( | const SbBool | enable | ) |
Set the flag deciding whether or not to show the axis cross.
Referenced by Gui::View3DInventorPy::setCornerCrossVisible().
void View3DInventorViewer::setGradientBackground | ( | bool | b | ) |
Referenced by imageFromFramebuffer(), and init().
void View3DInventorViewer::setGradientBackgroundColor | ( | const SbColor & | fromColor, |
const SbColor & | toColor | ||
) |
References Gui::SoFCBackgroundGradient::setColorGradient().
void View3DInventorViewer::setGradientBackgroundColor | ( | const SbColor & | fromColor, |
const SbColor & | toColor, | ||
const SbColor & | midColor | ||
) |
References Gui::SoFCBackgroundGradient::setColorGradient().
void View3DInventorViewer::setNaviCubeCorner | ( | int | c | ) |
References NaviCube::setCorner().
void View3DInventorViewer::setNavigationType | ( | Base::Type | t | ) |
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().
void View3DInventorViewer::setPopupMenuEnabled | ( | const SbBool | on | ) |
References Gui::NavigationStyle::setPopupMenuEnabled().
Referenced by Gui::View3DInventorPy::setPopupMenuEnabled().
void Gui::View3DInventorViewer::setRedirectToSceneGraph | ( | SbBool | redirect | ) |
void Gui::View3DInventorViewer::setRedirectToSceneGraphEnabled | ( | SbBool | enable | ) |
void View3DInventorViewer::setRenderCache | ( | int | mode | ) |
References Gui::ViewParams::instance(), and Gui::SoFCSeparator::setCacheMode().
Referenced by init().
void View3DInventorViewer::setRenderType | ( | const RenderType | type | ) |
References Framebuffer, getNumSamples(), grabFramebuffer(), Image, Native, and renderToFramebuffer().
void View3DInventorViewer::setSceneGraph | ( | SoNode * | root | ) |
Referenced by TechDrawGui::Grabber3d::copyActiveViewToSvgFile(), init(), and ~View3DInventorViewer().
|
protectedvirtual |
void View3DInventorViewer::setSelectionEnabled | ( | const SbBool | enable | ) |
Referenced by Gui::PointMarker::PointMarker(), and Gui::PointMarker::~PointMarker().
void View3DInventorViewer::setupEditingRoot | ( | SoNode * | node = nullptr , |
const Base::Matrix4D * | mat = nullptr |
||
) |
void View3DInventorViewer::setViewDirection | ( | SbVec3f | dir | ) |
Referenced by Gui::View3DInventorPy::setViewDirection().
|
virtual |
References Gui::NavigationStyle::IDLE, Gui::NavigationStyle::INTERACT, and Gui::NavigationStyle::setViewingMode().
Referenced by init(), and Gui::NavigationStyle::setViewing().
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().
Referenced by Gui::View3DInventorPy::startAnimating().
void View3DInventorViewer::startSelection | ( | View3DInventorViewer::SelectionMode | mode = Lasso | ) |
References Gui::NavigationStyle::startSelection().
void View3DInventorViewer::stopAnimating | ( | void | ) |
References Gui::NavigationStyle::stopAnimating().
Referenced by setSeekMode(), and Gui::View3DInventorPy::stopAnimating().
void View3DInventorViewer::stopSelection | ( | ) |
References setCursorEnabled(), and Gui::NavigationStyle::stopSelection().
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 getBoundingBox(), Base::Placement::getPosition(), Base::Placement::getRotation(), Base::Rotation::multVec(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by Gui::View3DInventorPy::toggleClippingPlane().
void View3DInventorViewer::turn3dDimensionsOff | ( | ) |
void View3DInventorViewer::turn3dDimensionsOn | ( | ) |
void View3DInventorViewer::turnAllDimensionsOff | ( | ) |
void View3DInventorViewer::turnAllDimensionsOn | ( | ) |
void View3DInventorViewer::turnDeltaDimensionsOff | ( | ) |
void View3DInventorViewer::turnDeltaDimensionsOn | ( | ) |
void View3DInventorViewer::updateOverrideMode | ( | const std::string & | mode | ) |
update override mode. doesn't affect providers
void View3DInventorViewer::viewAll | ( | ) |
Reposition the current camera so we can see the complete scene.
References animatedViewAll(), Gui::SoSkipBoundingGroup::EXCLUDE_BBOX, getBoundingBox(), Gui::SoSkipBoundingGroup::INCLUDE_BBOX, isAnimationEnabled(), and Gui::SoSkipBoundingGroup::mode.
Referenced by Gui::View3DInventorPy::fitAll(), and viewAll().
void View3DInventorViewer::viewAll | ( | float | factor | ) |
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(), draftutils.gui_utils::getSelection, 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, Gui::NoResolve, and Gui::Selection().
void View3DInventorViewer::viewVR | ( | void | ) |
Breaks out a VR window for a Rift.
|
friend |
|
friend |
Referenced by init().