FreeCAD C++
|
#include <Gui/View3DInventorViewer.h>
GUI view into a 3D scene provided by View3DInventor
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 |
Render mode | |
enum | RenderType |
Public Member Functions | |
virtual void | OnChange (Gui::SelectionSingleton::SubjectType &rCaller, Gui::SelectionSingleton::MessageType Reason) |
Observer message from the Selection. | |
bool | dumpToFile (SoNode *node, const char *filename, bool binary) const |
SbVec2f | screenCoordsOfPath (SoPath *path) const |
Returns the screen coordinates of the origin of the path's tail object. More... | |
void | addEventCallback (SoType eventtype, SoEventCallbackCB *cb, void *userdata=0) |
void | removeEventCallback (SoType eventtype, SoEventCallbackCB *cb, void *userdata=0) |
void | setCameraOrientation (const SbRotation &rot, SbBool moveTocenter=false) |
void | boxZoom (const SbBox2s &) |
void | viewAll () |
void | viewVR (void) |
Breaks out a VR window for a Rift. | |
void | viewSelection () |
Handling of view providers | |
SbBool | hasViewProvider (ViewProvider *) const |
void | addViewProvider (ViewProvider *) |
adds an ViewProvider to the view, e.g. from a feature | |
void | removeViewProvider (ViewProvider *) |
remove a ViewProvider | |
ViewProvider * | getViewProviderByPath (SoPath *) const |
get view provider by path | |
ViewProvider * | getViewProviderByPathFromTail (SoPath *) const |
std::vector< ViewProvider * > | getViewProvidersOfType (const Base::Type &typeId) const |
get all view providers of given type | |
SbBool | setEditingViewProvider (Gui::ViewProvider *p, int ModNum=0) |
set the ViewProvider in special edit mode | |
SbBool | isEditingViewProvider () const |
return whether a view provider is edited | |
void | resetEditingViewProvider () |
reset from edit mode | |
void | setOverrideMode (const std::string &mode) |
display override mode | |
void | updateOverrideMode (const std::string &mode) |
std::string | getOverrideMode () const |
Making pictures | |
void | savePicture (int w, int h, int s, const QColor &, QImage &) const |
void | saveGraphic (int pagesize, const QColor &, SoVectorizeAction *va) const |
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 |
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 |
SoPickedPoint * | pickPoint (const SbVec2s &pos) const |
const SoPickedPoint * | getPickedPoint (SoEventCallback *n) const |
SbBool | pubSeekToPoint (const SbVec2s &pos) |
void | pubSeekToPoint (const SbVec3f &pos) |
Clipping plane, near and far plane | |
SbVec3f | getViewDirection () const |
void | setViewDirection (SbVec3f) |
SbVec3f | getUpDirection () const |
SbRotation | getCameraOrientation () const |
SbVec3f | getPointOnScreen (const SbVec2s &) const |
void | getNearPlane (SbVec3f &rcPt, SbVec3f &rcNormal) const |
void | getFarPlane (SbVec3f &rcPt, SbVec3f &rcNormal) const |
void | toggleClippingPlane () |
bool | hasClippingPlane () const |
SbVec3f | projectOnNearPlane (const SbVec2f &) const |
SbVec3f | projectOnFarPlane (const SbVec2f &) const |
Dimension controls | |
the "turn*" functions are wired up to parameter groups through view3dinventor. don't call them directly. instead set the parameter groups.
| |
void | turnAllDimensionsOn () |
void | turnAllDimensionsOff () |
void | turn3dDimensionsOn () |
void | turn3dDimensionsOff () |
void | turnDeltaDimensionsOn () |
void | turnDeltaDimensionsOff () |
void | eraseAllDimensions () |
void | addDimension3d (SoNode *node) |
void | addDimensionDelta (SoNode *node) |
Static Public Member Functions | |
static int | getNumSamples () |
Get the preferred samples from the user settings. | |
void Gui::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.
void Gui::View3DInventorViewer::boxZoom | ( | const SbBox2s & | ) |
Zooms the viewport to the size of the bounding box.
bool Gui::View3DInventorViewer::dumpToFile | ( | SoNode * | node, |
const char * | filename, | ||
bool | binary | ||
) | const |
Writes the current scenegraph to an Inventor file, either in ascii or binary.
SbRotation Gui::View3DInventorViewer::getCameraOrientation | ( | ) | const |
Returns the orientation of the camera.
void Gui::View3DInventorViewer::getFarPlane | ( | SbVec3f & | rcPt, |
SbVec3f & | rcNormal | ||
) | const |
Returns the far plane represented by its normal and base point.
void Gui::View3DInventorViewer::getNearPlane | ( | SbVec3f & | rcPt, |
SbVec3f & | rcNormal | ||
) | const |
Returns the near plane represented by its normal and base point.
SbVec3f Gui::View3DInventorViewer::getPointOnScreen | ( | const SbVec2s & | ) | const |
Returns the 3d point on the focal plane to the given 2d point.
SbVec3f Gui::View3DInventorViewer::getUpDirection | ( | ) | const |
Returns the up direction
SbVec3f Gui::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.
bool Gui::View3DInventorViewer::hasClippingPlane | ( | ) | const |
Checks whether a clipping plane is set or not.
SbVec3f Gui::View3DInventorViewer::projectOnFarPlane | ( | const SbVec2f & | ) | const |
Project the given normalized 2d point onto the far plane
SbVec3f Gui::View3DInventorViewer::projectOnNearPlane | ( | const SbVec2f & | ) | const |
Project the given normalized 2d point onto the near plane
void Gui::View3DInventorViewer::removeEventCallback | ( | SoType | eventtype, |
SoEventCallbackCB * | cb, | ||
void * | userdata = 0 |
||
) |
Unregister the given callback function cb.
void Gui::View3DInventorViewer::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.
SbVec2f Gui::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.
void Gui::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.
void Gui::View3DInventorViewer::toggleClippingPlane | ( | ) |
Adds or remove a manipulator to/from the scenegraph.
void Gui::View3DInventorViewer::viewAll | ( | ) |
Reposition the current camera so we can see the complete scene.
void Gui::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.