#include <View3DInventorViewer.h>
Public Types | |
enum | eBackgroundType { Current = 0, Black = 1, White = 2, Transparent = 3 } |
Background modes for the savePicture() method. More... | |
enum | SelectionMode { Lasso = 0, Rectangle = 1, BoxZoom = 2, Clip = 3 } |
Pick modes for picking points in the scene. More... | |
Modus handling of the viewer | |
enum | ViewerMod { ShowCoord = 1, ShowFPS = 2, SimpleBackground = 4, DisallowRotation = 8, DisallowPanning = 16, DisallowZooming = 32 } |
Public Member Functions | |
void | addEventCallback (SoType eventtype, SoEventCallbackCB *cb, void *userdata=0) |
Set up a callback function cb which will be invoked for the given eventtype. | |
void | addFlag (Flag *, FlagLayout::Position) |
void | boxZoom (const SbBox2s &) |
Zooms the viewport to the size of the bounding box. | |
bool | dumpToFile (const char *filename, bool binary) const |
Writes the current scenegraph to an Inventor file, either in ascii or binary. | |
SoDirectionalLight * | getBacklight (void) const |
int | getFeedbackSize (void) const |
SbBool | isAnimating (void) const |
SbBool | isAnimationEnabled (void) const |
SbBool | isBacklight (void) const |
SbBool | isFeedbackVisible (void) const |
void | moveCameraTo (const SbRotation &rot, const SbVec3f &pos, int steps, int ms) |
NavigationStyle * | navigationStyle () const |
virtual void | OnChange (Gui::SelectionSingleton::SubjectType &rCaller, Gui::SelectionSingleton::MessageType Reason) |
Observer message from the Selection. | |
void | removeEventCallback (SoType eventtype, SoEventCallbackCB *cb, void *userdata=0) |
Unregister the given callback function cb. | |
void | setAnimationEnabled (const SbBool enable) |
void | setBacklight (SbBool on) |
void | setCameraOrientation (const SbRotation &rot) |
Set the camera's orientation. | |
void | setCameraType (SoType t) |
virtual void | setCursorEnabled (SbBool enable) |
void | setEnabledFPSCounter (bool b) |
void | setFeedbackSize (const int size) |
void | setFeedbackVisibility (const SbBool enable) |
void | setGradientBackgroud (bool b) |
void | setGradientBackgroudColor (const SbColor &fromColor, const SbColor &toColor, const SbColor &midColor) |
void | setGradientBackgroudColor (const SbColor &fromColor, const SbColor &toColor) |
void | setNavigationType (Base::Type) |
void | setSceneGraph (SoNode *root) |
virtual void | setViewing (SbBool enable) |
void | startAnimating (const SbVec3f &axis, float velocity) |
void | stopAnimating (void) |
View3DInventorViewer (QWidget *parent, const char *name=NULL, SbBool embed=true, Type type=SoQtViewer::BROWSER, SbBool build=true) | |
void | viewAll (float factor) |
void | viewAll () |
Reposition the current camera so we can see the complete scene. | |
void | viewSelection () |
Reposition the current camera so we can see all selected objects of the scene. | |
virtual | ~View3DInventorViewer () |
Handling of view providers | |
void | addViewProvider (ViewProvider *) |
adds an ViewProvider to the view, e.g. from a feature | |
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 | hasViewProvider (ViewProvider *) const |
SbBool | isEditingViewProvider () const |
return whether a view provider is edited | |
void | removeViewProvider (ViewProvider *) |
remove a ViewProvider | |
void | resetEditingViewProvider () |
reset from edit mode | |
SbBool | setEditingViewProvider (Gui::ViewProvider *p, int ModNum=0) |
set the ViewProvider in special edit mode | |
Draw routines | |
void | drawLine (int x1, int y1, int x2, int y2) |
void | drawRect (int x, int y, int w, int h) |
Clipping plane, near and far plane | |
void | getFarPlane (SbVec3f &rcPt, SbVec3f &rcNormal) const |
Returns the far plane represented by its normal and base point. | |
void | getNearPlane (SbVec3f &rcPt, SbVec3f &rcNormal) const |
Returns the near plane represented by its normal and base point. | |
SbVec3f | getPointOnScreen (const SbVec2s &) const |
Returns the 3d point on the focal plane to the given 2d point. | |
SbVec3f | getUpDirection () const |
Returns the up direction. | |
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. | |
bool | hasClippingPlane () const |
Checks whether a clipping plane is set or not. | |
SbVec3f | projectOnFarPlane (const SbVec2f &) const |
Project the given normalized 2d point onto the far plane. | |
SbVec3f | projectOnNearPlane (const SbVec2f &) const |
Project the given normalized 2d point onto the near plane. | |
void | toggleClippingPlane () |
Adds or remove a manipulator to/from the scenegraph. | |
Selection methods | |
std::vector< SbVec2f > | getGLPolygon (const std::vector< SbVec2s > &) const |
std::vector< SbVec2f > | getGLPolygon (SbBool *clip_inner=0) const |
const std::vector< SbVec2s > & | getPolygon (SbBool *clip_inner=0) const |
bool | isSelecting () const |
void | startSelection (SelectionMode=Lasso) |
void | stopSelection () |
Edit methods | |
SbBool | isEditing () const |
SbBool | isRedirectedToSceneGraph () const |
void | setEditing (SbBool edit) |
void | setEditingCursor (const QCursor &cursor) |
void | setEditingCursor (const SoQtCursor &cursor) |
void | setRedirectToSceneGraph (SbBool redirect) |
Pick actions | |
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. | |
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. | |
void | pubSeekToPoint (const SbVec3f &pos) |
SbBool | pubSeekToPoint (const SbVec2s &pos) |
Making pictures | |
void | saveGraphic (int pagesize, int eBackgroundType, SoVectorizeAction *va) const |
void | savePicture (int w, int h, int eBackgroundType, QImage &) const |
void | savePicture (const char *filename, int w, int h, int eBackgroundType, const char *comment) const |
Creates an image with width w and height h of the current scene graph and exports the rendered scenegraph directly to file filename. | |
Protected Member Functions | |
virtual void | actualRedraw (void) |
virtual void | afterRealizeHook (void) |
void | printDimension () |
virtual void | processEvent (QEvent *event) |
virtual SbBool | processSoEvent (const SoEvent *const ev) |
SbBool | processSoEventBase (const SoEvent *const ev) |
void | selectAll () |
virtual void | setSeekMode (SbBool enable) |
Static Protected Member Functions | |
static void | clearBuffer (void *userdata, SoAction *action) |
static void | handleEventCB (void *userdata, SoEventCallback *n) |
static void | interactionFinishCB (void *data, SoQtViewer *viewer) |
Sets the SoFCInteractiveElement to false and forces a redraw. | |
static void | interactionLoggerCB (void *ud, SoAction *action) |
Logs the type of the action that traverses the Inventor tree. | |
static void | interactionStartCB (void *data, SoQtViewer *viewer) |
Sets the SoFCInteractiveElement to true. | |
static void | setGLWidget (void *userdata, SoAction *action) |
Friends | |
class | NavigationStyle |
The Inventor viewer.
Definition at line 59 of file View3DInventorViewer.h.
Background modes for the savePicture() method.
Current |
Use the current viewer Background. |
Black |
Black background. |
White |
White background. |
Transparent |
Transparent background. |
Definition at line 65 of file View3DInventorViewer.h.
Pick modes for picking points in the scene.
Lasso |
Select objects using a lasso. |
Rectangle |
Select objects using a rectangle. |
BoxZoom |
Perform a box zoom. |
Clip |
Clip objects using a lasso. |
Definition at line 72 of file View3DInventorViewer.h.
Definition at line 83 of file View3DInventorViewer.h.
View3DInventorViewer::View3DInventorViewer | ( | QWidget * | parent, | |
const char * | name = NULL , |
|||
SbBool | embed = true , |
|||
Type | type = SoQtViewer::BROWSER , |
|||
SbBool | build = true | |||
) |
Definition at line 136 of file View3DInventorViewer.cpp.
References Gui::SoFCUnifiedSelection::applySettings(), Base::Subject< _MessageType >::Attach(), SketcherExample::f, handleEventCB(), interactionFinishCB(), interactionLoggerCB(), interactionStartCB(), Gui::Selection(), setGradientBackgroud(), setSceneGraph(), setViewing(), and Gui::SoFCUnifiedSelection::viewer.
View3DInventorViewer::~View3DInventorViewer | ( | ) | [virtual] |
Definition at line 267 of file View3DInventorViewer.cpp.
References Base::Subject< _MessageType >::Detach(), Gui::getMainWindow(), Gui::Selection(), Gui::MainWindow::setPaneText(), and setSceneGraph().
void View3DInventorViewer::actualRedraw | ( | void | ) | [protected, virtual] |
Definition at line 873 of file View3DInventorViewer.cpp.
References Gui::Flag::drawLine(), SketcherExample::f, Gui::Flag::getOrigin(), Py::int, isAnimating(), printDimension(), Gui::NavigationStyle::redraw(), boost::numeric::bindings::atlas::set(), and Gui::NavigationStyle::updateAnimation().
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.
Definition at line 2070 of file View3DInventorViewer.cpp.
Referenced by StdCmdMeasureDistance::activated(), CmdPointsPolyCut::activated(), CmdMeshFillInteractiveHole::activated(), CmdMeshRemoveCompByHand::activated(), CmdMeshEvaluateFacet::activated(), CmdMeshPolySplit::activated(), CmdMeshPolyCut::activated(), CmdMeshPolySelect::activated(), CmdMeshPolySegm::activated(), CmdMeshVertexCurvatureInfo::activated(), CmdInspectElement::activated(), Gui::View3DInventorPy::addEventCallback(), Gui::View3DInventorPy::addEventCallbackPivy(), CamGui::Cutting::on_SelectFace_button_clicked(), CamGui::Cutting::on_toolpath_calculation_highest_level_button_clicked(), CamGui::Cutting::on_toolpath_calculation_lowest_level_button_clicked(), CamGui::Cutting::on_toolpath_calculation_middle_level_button_clicked(), setEditingViewProvider(), and MeshGui::MeshFaceAddition::startEditing().
void View3DInventorViewer::addFlag | ( | Flag * | item, | |
FlagLayout::Position | pos | |||
) |
Definition at line 2122 of file View3DInventorViewer.cpp.
Referenced by InspectionGui::addFlag(), and MeshGui::ViewProviderMesh::faceInfoCallback().
void View3DInventorViewer::addViewProvider | ( | ViewProvider * | pcProvider | ) |
adds an ViewProvider to the view, e.g. from a feature
Definition at line 322 of file View3DInventorViewer.cpp.
References Gui::ViewProvider::getBackRoot(), Gui::ViewProvider::getFrontRoot(), and Gui::ViewProvider::getRoot().
Referenced by Gui::Document::createView(), Gui::PointMarker::PointMarker(), Gui::Document::setAnnotationViewProvider(), Gui::Document::slotNewObject(), and MeshGui::MeshFaceAddition::startEditing().
void View3DInventorViewer::afterRealizeHook | ( | void | ) | [protected, virtual] |
Definition at line 1692 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::getViewingMode().
void View3DInventorViewer::boxZoom | ( | const SbBox2s & | box | ) |
Zooms the viewport to the size of the bounding box.
Definition at line 1351 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::boxZoom().
Referenced by Gui::BoxZoomSelection::terminate().
void View3DInventorViewer::clearBuffer | ( | void * | userdata, | |
SoAction * | action | |||
) | [static, protected] |
Definition at line 389 of file View3DInventorViewer.cpp.
Referenced by savePicture().
void View3DInventorViewer::drawLine | ( | int | x1, | |
int | y1, | |||
int | x2, | |||
int | y2 | |||
) |
Definition at line 1526 of file View3DInventorViewer.cpp.
References SketcherExample::f.
Referenced by Gui::PolyPickerSelection::draw().
void View3DInventorViewer::drawRect | ( | int | x, | |
int | y, | |||
int | w, | |||
int | h | |||
) |
Definition at line 1468 of file View3DInventorViewer.cpp.
References SketcherExample::f.
Referenced by Gui::RectangleSelection::draw().
bool View3DInventorViewer::dumpToFile | ( | const char * | filename, | |
bool | binary | |||
) | const |
Writes the current scenegraph to an Inventor file, either in ascii or binary.
Definition at line 763 of file View3DInventorViewer.cpp.
References buffer, zipios::GZIPOutputStream::close(), Base::FileInfo::hasExtension(), saveGraphic(), RobotExample::t, and Gui::SoFCDB::writeNodesToString().
Referenced by Gui::View3DInventor::dump().
SoDirectionalLight * View3DInventorViewer::getBacklight | ( | void | ) | const |
Definition at line 477 of file View3DInventorViewer.cpp.
Referenced by Gui::View3DInventor::OnChange().
void View3DInventorViewer::getFarPlane | ( | SbVec3f & | rcPt, | |
SbVec3f & | rcNormal | |||
) | const |
Returns the far plane represented by its normal and base point.
Definition at line 1186 of file View3DInventorViewer.cpp.
int View3DInventorViewer::getFeedbackSize | ( | void | ) | const |
Return the size of the feedback axis cross. Default is 10.
Definition at line 1677 of file View3DInventorViewer.cpp.
std::vector< SbVec2f > View3DInventorViewer::getGLPolygon | ( | const std::vector< SbVec2s > & | pnts | ) | const |
Definition at line 723 of file View3DInventorViewer.cpp.
References SketcherExample::f, RobotExample::pos, and RobotExample::w.
std::vector< SbVec2f > View3DInventorViewer::getGLPolygon | ( | SbBool * | clip_inner = 0 |
) | const |
Definition at line 757 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::getPolygon().
Referenced by MeshGui::ViewProviderMesh::clipMeshCallback(), PointsGui::ViewProviderPoints::clipPointsCallback(), MeshGui::ViewProviderMesh::partMeshCallback(), MeshGui::ViewProviderMesh::segmMeshCallback(), and MeshGui::ViewProviderMesh::selectGLCallback().
void View3DInventorViewer::getNearPlane | ( | SbVec3f & | rcPt, | |
SbVec3f & | rcNormal | |||
) | const |
Returns the near plane represented by its normal and base point.
Definition at line 1171 of file View3DInventorViewer.cpp.
Referenced by DrawingGui::TaskProjection::accept(), MeshGui::ViewProviderMesh::getFacetsFromPolygon(), MeshGui::ViewProviderMeshNode::handleEvent(), MeshGui::ViewProviderMesh::partMeshCallback(), and MeshGui::ViewProviderMesh::segmMeshCallback().
SbVec3f View3DInventorViewer::getPointOnScreen | ( | const SbVec2s & | pnt | ) | const |
Returns the 3d point on the focal plane to the given 2d point.
Definition at line 1132 of file View3DInventorViewer.cpp.
References SketcherExample::f, MovieTool::x, and MovieTool::y.
Referenced by Gui::ViewProvider::eventCallback(), and Gui::View3DInventorPy::getPoint().
const std::vector< SbVec2s > & View3DInventorViewer::getPolygon | ( | SbBool * | clip_inner = 0 |
) | const |
Definition at line 718 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::getPolygon().
SbVec3f View3DInventorViewer::getUpDirection | ( | ) | const |
Returns the up direction.
Definition at line 1122 of file View3DInventorViewer.cpp.
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.
Definition at line 1112 of file View3DInventorViewer.cpp.
Referenced by Gui::ViewProvider::eventCallback(), and Gui::View3DInventorPy::getViewDirection().
ViewProvider * View3DInventorViewer::getViewProviderByPath | ( | SoPath * | path | ) | const |
get view provider by path
Definition at line 2080 of file View3DInventorViewer.cpp.
Referenced by MeshGui::ViewProviderMeshCurvature::curvatureInfoCallback(), MeshGui::ViewProviderMesh::faceInfoCallback(), MeshGui::ViewProviderMesh::fillHoleCallback(), Gui::View3DInventorPy::getObjectInfo(), Gui::View3DInventorPy::getObjectsInfo(), InspectionGui::ViewProviderInspection::inspectCallback(), MeshGui::ViewProviderMesh::markPartCallback(), and PartGui::ViewProviderPartBase::shapeInfoCallback().
ViewProvider * View3DInventorViewer::getViewProviderByPathFromTail | ( | SoPath * | path | ) | const |
Definition at line 2095 of file View3DInventorViewer.cpp.
Referenced by Gui::SoFCUnifiedSelection::handleEvent().
std::vector< ViewProvider * > View3DInventorViewer::getViewProvidersOfType | ( | const Base::Type & | typeId | ) | const |
get all view providers of given type
Definition at line 2111 of file View3DInventorViewer.cpp.
Referenced by MeshGui::ViewProviderMesh::clipMeshCallback(), PointsGui::ViewProviderPoints::clipPointsCallback(), Gui::SoFCUnifiedSelection::doAction(), MeshGui::ViewProviderMesh::markPartCallback(), MeshGui::ViewProviderMesh::partMeshCallback(), MeshGui::ViewProviderMesh::segmMeshCallback(), and MeshGui::ViewProviderMesh::selectGLCallback().
void View3DInventorViewer::handleEventCB | ( | void * | userdata, | |
SoEventCallback * | n | |||
) | [static, protected] |
Definition at line 408 of file View3DInventorViewer.cpp.
References boost::numeric::bindings::atlas::set().
Referenced by View3DInventorViewer().
bool View3DInventorViewer::hasClippingPlane | ( | ) | const |
Checks whether a clipping plane is set or not.
Definition at line 1243 of file View3DInventorViewer.cpp.
Referenced by Gui::View3DInventor::hasClippingPlane().
SbBool View3DInventorViewer::hasViewProvider | ( | ViewProvider * | pcProvider | ) | const |
Definition at line 316 of file View3DInventorViewer.cpp.
void View3DInventorViewer::interactionFinishCB | ( | void * | data, | |
SoQtViewer * | viewer | |||
) | [static, protected] |
Sets the SoFCInteractiveElement to false and forces a redraw.
Definition at line 855 of file View3DInventorViewer.cpp.
References boost::numeric::bindings::atlas::set().
Referenced by View3DInventorViewer().
void View3DInventorViewer::interactionLoggerCB | ( | void * | ud, | |
SoAction * | action | |||
) | [static, protected] |
Logs the type of the action that traverses the Inventor tree.
Definition at line 865 of file View3DInventorViewer.cpp.
References Base::Console().
Referenced by View3DInventorViewer().
void View3DInventorViewer::interactionStartCB | ( | void * | data, | |
SoQtViewer * | viewer | |||
) | [static, protected] |
Sets the SoFCInteractiveElement to true.
Definition at line 846 of file View3DInventorViewer.cpp.
References boost::numeric::bindings::atlas::set().
Referenced by View3DInventorViewer().
SbBool View3DInventorViewer::isAnimating | ( | void | ) | const |
Query if the model in the viewer is currently in spinning mode after a user drag.
Definition at line 1609 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::isAnimating().
Referenced by actualRedraw(), Gui::Dialog::DemoMode::on_angleSlider_valueChanged(), Gui::Dialog::DemoMode::on_playButton_clicked(), Gui::Dialog::DemoMode::on_speedSlider_valueChanged(), Gui::Dialog::DemoMode::onAutoPlay(), 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.
Definition at line 1600 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::isAnimationEnabled().
Referenced by Gui::View3DInventorPy::isAnimationEnabled().
SbBool View3DInventorViewer::isBacklight | ( | void | ) | const |
Definition at line 487 of file View3DInventorViewer.cpp.
SbBool Gui::View3DInventorViewer::isEditing | ( | ) | const [inline] |
Definition at line 175 of file View3DInventorViewer.h.
Referenced by StdCmdMeasureDistance::isActive(), StdCmdToggleNavigation::isActive(), CmdShapeInfo::isActive(), CmdMeshFillInteractiveHole::isActive(), CmdMeshRemoveCompByHand::isActive(), CmdMeshEvaluateFacet::isActive(), CmdMeshPolySplit::isActive(), CmdMeshPolyCut::isActive(), CmdMeshAddFacet::isActive(), CmdMeshPolySelect::isActive(), CmdMeshPolySegm::isActive(), CmdMeshVertexCurvatureInfo::isActive(), CmdInspectElement::isActive(), Gui::InventorNavigationStyle::processSoEvent(), Gui::CADNavigationStyle::processSoEvent(), and Gui::BlenderNavigationStyle::processSoEvent().
SbBool View3DInventorViewer::isEditingViewProvider | ( | ) | const |
return whether a view provider is edited
reset from edit mode
Definition at line 384 of file View3DInventorViewer.cpp.
Referenced by Gui::Document::getInEdit().
SbBool View3DInventorViewer::isFeedbackVisible | ( | void | ) | const |
Check if the feedback axis cross is visible.
Definition at line 1648 of file View3DInventorViewer.cpp.
Referenced by setFeedbackSize().
SbBool Gui::View3DInventorViewer::isRedirectedToSceneGraph | ( | ) | const [inline] |
Definition at line 179 of file View3DInventorViewer.h.
Referenced by StdCmdToggleNavigation::activated(), InspectionGui::ViewProviderInspection::inspectCallback(), and processSoEvent().
bool View3DInventorViewer::isSelecting | ( | ) | const |
Definition at line 713 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::isSelecting().
Referenced by StdViewBoxZoom::activated().
void View3DInventorViewer::moveCameraTo | ( | const SbRotation & | rot, | |
const SbVec3f & | pos, | |||
int | steps, | |||
int | ms | |||
) |
Definition at line 1322 of file View3DInventorViewer.cpp.
References draftlibs::fcgeo::connect().
Referenced by Gui::View3DInventorPy::viewPosition().
NavigationStyle * View3DInventorViewer::navigationStyle | ( | ) | const |
Definition at line 472 of file View3DInventorViewer.cpp.
Referenced by Gui::View3DInventorPy::getNavigationType(), and Gui::View3DInventor::OnChange().
virtual void Gui::View3DInventorViewer::OnChange | ( | Gui::SelectionSingleton::SubjectType & | rCaller, | |
Gui::SelectionSingleton::MessageType | Reason | |||
) | [virtual] |
Observer message from the Selection.
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.
Definition at line 1281 of file View3DInventorViewer.cpp.
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.
Definition at line 1258 of file View3DInventorViewer.cpp.
Referenced by PartGui::ViewProviderCurveNet::handleEvent().
void View3DInventorViewer::printDimension | ( | ) | [protected] |
Definition at line 962 of file View3DInventorViewer.cpp.
References dim, SketcherExample::f, Gui::getMainWindow(), Py::int, Gui::MainWindow::setPaneText(), and RobotExample::t.
Referenced by actualRedraw().
void View3DInventorViewer::processEvent | ( | QEvent * | event | ) | [protected, virtual] |
As ProgressBar has no chance to control the incoming Qt events of SoQt we need to override SoQtViewer::processEvent() to prevent the scenegraph from being selected or deselected while the progress bar is running.
Definition at line 1034 of file View3DInventorViewer.cpp.
References Spaceball::ButtonEvent::ButtonEventType, Base::Console(), SketcherExample::f, Spaceball::MotionEvent::MotionEventType, processSoEvent(), Spaceball::MotionEvent::rotationX(), Spaceball::MotionEvent::rotationY(), Spaceball::MotionEvent::rotationZ(), selectAll(), Base::Sequencer(), Spaceball::MotionEvent::translationX(), Spaceball::MotionEvent::translationY(), and Spaceball::MotionEvent::translationZ().
SbBool View3DInventorViewer::processSoEvent | ( | const SoEvent *const | ev | ) | [protected, virtual] |
Definition at line 1084 of file View3DInventorViewer.cpp.
References isRedirectedToSceneGraph(), and Gui::NavigationStyle::processEvent().
Referenced by processEvent(), and processSoEventBase().
SbBool View3DInventorViewer::processSoEventBase | ( | const SoEvent *const | ev | ) | [protected] |
Definition at line 1107 of file View3DInventorViewer.cpp.
References processSoEvent().
Referenced by Gui::NavigationStyle::processSoEvent().
SbVec3f View3DInventorViewer::projectOnFarPlane | ( | const SbVec2f & | pt | ) | const |
Project the given normalized 2d point onto the far plane.
Definition at line 1211 of file View3DInventorViewer.cpp.
SbVec3f View3DInventorViewer::projectOnNearPlane | ( | const SbVec2f & | pt | ) | const |
Project the given normalized 2d point onto the near plane.
Definition at line 1201 of file View3DInventorViewer.cpp.
void View3DInventorViewer::pubSeekToPoint | ( | const SbVec3f & | pos | ) |
Definition at line 1298 of file View3DInventorViewer.cpp.
SbBool View3DInventorViewer::pubSeekToPoint | ( | const SbVec2s & | pos | ) |
Definition at line 1293 of file View3DInventorViewer.cpp.
Referenced by wrap_SoQtViewer_seekToPoint().
void View3DInventorViewer::removeEventCallback | ( | SoType | eventtype, | |
SoEventCallbackCB * | cb, | |||
void * | userdata = 0 | |||
) |
Unregister the given callback function cb.
Definition at line 2075 of file View3DInventorViewer.cpp.
Referenced by MeshGui::ViewProviderMesh::clipMeshCallback(), PointsGui::ViewProviderPoints::clipPointsCallback(), MeshGui::ViewProviderMeshCurvature::curvatureInfoCallback(), MeshGui::ViewProviderMesh::faceInfoCallback(), MeshGui::ViewProviderMesh::fillHoleCallback(), MeshGui::MeshFaceAddition::finishEditing(), InspectionGui::ViewProviderInspection::inspectCallback(), MeshGui::ViewProviderMesh::markPartCallback(), Gui::ViewProviderMeasureDistance::measureDistanceCallback(), MeshGui::ViewProviderMesh::partMeshCallback(), Gui::View3DInventorPy::removeEventCallback(), Gui::View3DInventorPy::removeEventCallbackPivy(), resetEditingViewProvider(), MeshGui::ViewProviderMesh::segmMeshCallback(), MeshGui::ViewProviderMesh::selectGLCallback(), PartGui::ViewProviderPartBase::shapeInfoCallback(), and PartGui::DlgPrimitives::~DlgPrimitives().
void View3DInventorViewer::removeViewProvider | ( | ViewProvider * | pcProvider | ) |
remove a ViewProvider
Definition at line 337 of file View3DInventorViewer.cpp.
References Gui::ViewProvider::getBackRoot(), Gui::ViewProvider::getFrontRoot(), Gui::ViewProvider::getRoot(), and resetEditingViewProvider().
Referenced by MeshGui::MeshFaceAddition::finishEditing(), Gui::Document::removeAnnotationViewProvider(), Gui::Document::slotDeletedObject(), and Gui::PointMarker::~PointMarker().
void View3DInventorViewer::resetEditingViewProvider | ( | ) |
reset from edit mode
Definition at line 373 of file View3DInventorViewer.cpp.
References Gui::ViewProvider::eventCallback(), Gui::ViewProvider::finishEditing(), removeEventCallback(), and Gui::ViewProvider::unsetEditViewer().
Referenced by removeViewProvider(), and Gui::Document::resetEdit().
void View3DInventorViewer::saveGraphic | ( | int | pagesize, | |
int | eBackgroundType, | |||
SoVectorizeAction * | va | |||
) | const |
Definition at line 644 of file View3DInventorViewer.cpp.
References Black, Current, SketcherExample::f, Transparent, and White.
Referenced by dumpToFile(), Gui::View3DInventor::print(), and Gui::View3DInventorPy::saveVectorGraphic().
void View3DInventorViewer::savePicture | ( | int | w, | |
int | h, | |||
int | eBackgroundType, | |||
QImage & | img | |||
) | const |
Definition at line 577 of file View3DInventorViewer.cpp.
References Black, clearBuffer(), Current, Gui::SoFCOffscreenRenderer::instance(), setGLWidget(), Transparent, White, and Gui::SoFCOffscreenRenderer::writeToImage().
void View3DInventorViewer::savePicture | ( | const char * | filename, | |
int | w, | |||
int | h, | |||
int | eBackgroundType, | |||
const char * | comment | |||
) | const |
Creates an image with width w and height h of the current scene graph and exports the rendered scenegraph directly to file filename.
If comment is set to '$MIBA' information regarding the MIBA standard is embedded to the picture, otherwise the comment is embedded as is. The appropriate file format must support embedding meta information which is provided by JPEG or PNG.
Definition at line 506 of file View3DInventorViewer.cpp.
References Gui::SoFCOffscreenRenderer::_Matrix, Black, clearBuffer(), Current, Gui::SoFCOffscreenRenderer::instance(), setGLWidget(), Transparent, White, and Gui::SoFCOffscreenRenderer::writeToImageFile().
Referenced by Gui::View3DInventor::print(), Gui::Thumbnail::SaveDocFile(), and Gui::View3DInventorPy::saveImage().
void View3DInventorViewer::selectAll | ( | ) | [protected] |
Definition at line 1014 of file View3DInventorViewer.cpp.
References Gui::ViewProviderDocumentObject::getClassTypeId(), Gui::ViewProviderDocumentObject::getObject(), Gui::Selection(), and Gui::SelectionSingleton::setSelection().
Referenced by processEvent().
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.
Definition at line 1589 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::setAnimationEnabled().
Referenced by Gui::View3DInventor::OnChange(), and Gui::View3DInventorPy::setAnimationEnabled().
void View3DInventorViewer::setBacklight | ( | SbBool | on | ) |
Definition at line 482 of file View3DInventorViewer.cpp.
Referenced by Gui::View3DInventor::OnChange().
void View3DInventorViewer::setCameraOrientation | ( | const SbRotation & | rot | ) |
Set the camera's orientation.
If isAnimationEnabled() returns TRUE the reorientation is animated, otherwise its directly set.
Definition at line 1303 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::setCameraOrientation().
Referenced by Gui::View3DInventor::onMsg(), Gui::View3DInventorPy::setCameraOrientation(), SketcherGui::ViewProviderSketch::setEditViewer(), Gui::View3DInventorPy::viewAxometric(), Gui::View3DInventorPy::viewBottom(), Gui::View3DInventorPy::viewFront(), Gui::View3DInventorPy::viewLeft(), Gui::View3DInventorPy::viewRear(), Gui::View3DInventorPy::viewRight(), and Gui::View3DInventorPy::viewTop().
void View3DInventorViewer::setCameraType | ( | SoType | t | ) |
Definition at line 1308 of file View3DInventorViewer.cpp.
References M_PI.
Referenced by Gui::View3DInventor::OnChange(), Gui::View3DInventor::onMsg(), Gui::View3DInventor::setCamera(), and Gui::View3DInventorPy::setCameraType().
void View3DInventorViewer::setCursorEnabled | ( | SbBool | enable | ) | [virtual] |
Decide whether or not the mouse pointer cursor should be visible in the rendering canvas.
Definition at line 1686 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::getViewingMode().
void View3DInventorViewer::setEditing | ( | SbBool | edit | ) |
Definition at line 2011 of file View3DInventorViewer.cpp.
Referenced by StdCmdMeasureDistance::activated(), CmdPointsPolyCut::activated(), CmdMeshFillInteractiveHole::activated(), CmdMeshRemoveCompByHand::activated(), CmdMeshEvaluateFacet::activated(), CmdMeshPolySplit::activated(), CmdMeshPolyCut::activated(), CmdMeshPolySelect::activated(), CmdMeshPolySegm::activated(), CmdMeshVertexCurvatureInfo::activated(), CmdInspectElement::activated(), MeshGui::ViewProviderMesh::clipMeshCallback(), PointsGui::ViewProviderPoints::clipPointsCallback(), MeshGui::ViewProviderMeshCurvature::curvatureInfoCallback(), MeshGui::ViewProviderMesh::faceInfoCallback(), MeshGui::ViewProviderMesh::fillHoleCallback(), MeshGui::MeshFaceAddition::finishEditing(), InspectionGui::ViewProviderInspection::inspectCallback(), MeshGui::ViewProviderMesh::markPartCallback(), Gui::ViewProviderMeasureDistance::measureDistanceCallback(), CamGui::Cutting::on_SelectFace_button_clicked(), CamGui::Cutting::on_toolpath_calculation_highest_level_button_clicked(), CamGui::Cutting::on_toolpath_calculation_lowest_level_button_clicked(), CamGui::Cutting::on_toolpath_calculation_middle_level_button_clicked(), MeshGui::ViewProviderMesh::partMeshCallback(), MeshGui::ViewProviderMesh::segmMeshCallback(), MeshGui::ViewProviderMesh::selectGLCallback(), SketcherGui::ViewProviderSketch::setEditViewer(), PartGui::ViewProviderPartBase::shapeInfoCallback(), MeshGui::MeshFaceAddition::startEditing(), SketcherGui::ViewProviderSketch::unsetEditViewer(), and PartGui::DlgPrimitives::~DlgPrimitives().
void View3DInventorViewer::setEditingCursor | ( | const QCursor & | cursor | ) |
Definition at line 2028 of file View3DInventorViewer.cpp.
void View3DInventorViewer::setEditingCursor | ( | const SoQtCursor & | cursor | ) |
Definition at line 2018 of file View3DInventorViewer.cpp.
Referenced by CmdMeshFillInteractiveHole::activated(), CmdMeshEvaluateFacet::activated(), CmdMeshVertexCurvatureInfo::activated(), and CmdInspectElement::activated().
SbBool View3DInventorViewer::setEditingViewProvider | ( | Gui::ViewProvider * | p, | |
int | ModNum = 0 | |||
) |
set the ViewProvider in special edit mode
Definition at line 356 of file View3DInventorViewer.cpp.
References addEventCallback(), Gui::ViewProvider::eventCallback(), Gui::ViewProvider::setEditViewer(), and Gui::ViewProvider::startEditing().
Referenced by Gui::Document::setEdit().
void View3DInventorViewer::setEnabledFPSCounter | ( | bool | b | ) |
Definition at line 438 of file View3DInventorViewer.cpp.
Referenced by Gui::View3DInventor::OnChange().
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.
Definition at line 1659 of file View3DInventorViewer.cpp.
References isFeedbackVisible().
void View3DInventorViewer::setFeedbackVisibility | ( | const SbBool | enable | ) |
Set the flag deciding whether or not to show the axis cross.
Definition at line 1633 of file View3DInventorViewer.cpp.
Referenced by Gui::View3DInventor::OnChange().
void View3DInventorViewer::setGLWidget | ( | void * | userdata, | |
SoAction * | action | |||
) | [static, protected] |
Definition at line 397 of file View3DInventorViewer.cpp.
References boost::numeric::bindings::atlas::set().
Referenced by savePicture().
void View3DInventorViewer::setGradientBackgroud | ( | bool | b | ) |
Definition at line 417 of file View3DInventorViewer.cpp.
Referenced by Gui::View3DInventor::OnChange(), and View3DInventorViewer().
void View3DInventorViewer::setGradientBackgroudColor | ( | const SbColor & | fromColor, | |
const SbColor & | toColor, | |||
const SbColor & | midColor | |||
) |
Definition at line 431 of file View3DInventorViewer.cpp.
References Gui::SoFCBackgroundGradient::setColorGradient().
void View3DInventorViewer::setGradientBackgroudColor | ( | const SbColor & | fromColor, | |
const SbColor & | toColor | |||
) |
Definition at line 425 of file View3DInventorViewer.cpp.
References Gui::SoFCBackgroundGradient::setColorGradient().
Referenced by Gui::View3DInventor::OnChange().
void View3DInventorViewer::setNavigationType | ( | Base::Type | t | ) |
Definition at line 447 of file View3DInventorViewer.cpp.
References Base::Type::createInstance(), Gui::NavigationStyle::getClassTypeId(), Base::BaseClass::getTypeId(), Gui::NavigationStyle::getTypeId(), Base::Type::isBad(), and Gui::NavigationStyle::setViewer().
Referenced by Gui::View3DInventor::customEvent(), Gui::View3DInventor::OnChange(), and Gui::View3DInventorPy::setNavigationType().
void Gui::View3DInventorViewer::setRedirectToSceneGraph | ( | SbBool | redirect | ) | [inline] |
Definition at line 178 of file View3DInventorViewer.h.
Referenced by StdCmdToggleNavigation::activated(), CmdMeshVertexCurvatureInfo::activated(), CmdInspectElement::activated(), MeshGui::ViewProviderMeshCurvature::curvatureInfoCallback(), MeshGui::MeshFaceAddition::finishEditing(), InspectionGui::ViewProviderInspection::inspectCallback(), MeshGui::MeshFaceAddition::startEditing(), and PartGui::DlgPrimitives::~DlgPrimitives().
void View3DInventorViewer::setSceneGraph | ( | SoNode * | root | ) |
Definition at line 492 of file View3DInventorViewer.cpp.
Referenced by Gui::View3DInventor::onMsg(), View3DInventorViewer(), and ~View3DInventorViewer().
void View3DInventorViewer::setSeekMode | ( | SbBool | enable | ) | [protected, virtual] |
Definition at line 947 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::IDLE, Gui::NavigationStyle::INTERACT, isAnimating(), Gui::NavigationStyle::SEEK_WAIT_MODE, Gui::NavigationStyle::setViewingMode(), and stopAnimating().
Referenced by Gui::NavigationStyle::setSeekMode().
void View3DInventorViewer::setViewing | ( | SbBool | enable | ) | [virtual] |
Definition at line 1700 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::IDLE, Gui::NavigationStyle::INTERACT, and Gui::NavigationStyle::setViewingMode().
Referenced by Gui::NavigationStyle::setViewing(), and View3DInventorViewer().
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.
Definition at line 1618 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::startAnimating().
Referenced by Gui::View3DInventorPy::startAnimating().
void View3DInventorViewer::startSelection | ( | View3DInventorViewer::SelectionMode | mode = Lasso |
) |
Definition at line 703 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::startSelection().
Referenced by StdViewBoxZoom::activated(), CmdPointsPolyCut::activated(), CmdMeshPolySplit::activated(), CmdMeshPolyCut::activated(), CmdMeshPolySelect::activated(), CmdMeshPolySegm::activated(), MeshGui::RemoveComponents::on_deselectRegion_clicked(), and MeshGui::RemoveComponents::on_selectRegion_clicked().
void View3DInventorViewer::stopAnimating | ( | void | ) |
Definition at line 1623 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::stopAnimating().
Referenced by Gui::Dialog::DemoMode::on_stopButton_clicked(), setSeekMode(), Gui::View3DInventorPy::stopAnimating(), and Gui::View3DInventor::stopAnimating().
void View3DInventorViewer::stopSelection | ( | ) |
Definition at line 708 of file View3DInventorViewer.cpp.
References Gui::NavigationStyle::stopSelection().
void View3DInventorViewer::toggleClippingPlane | ( | ) |
Adds or remove a manipulator to/from the scenegraph.
Definition at line 1221 of file View3DInventorViewer.cpp.
References SketcherExample::f.
Referenced by Gui::View3DInventor::toggleClippingPlane().
void View3DInventorViewer::viewAll | ( | float | factor | ) |
Definition at line 1383 of file View3DInventorViewer.cpp.
References Gui::SoSkipBoundingGroup::EXCLUDE_BBOX, SketcherExample::f, group, Gui::SoSkipBoundingGroup::INCLUDE_BBOX, Gui::SoSkipBoundingGroup::mode, and viewAll().
void View3DInventorViewer::viewAll | ( | ) |
Reposition the current camera so we can see the complete scene.
Definition at line 1356 of file View3DInventorViewer.cpp.
References Gui::SoSkipBoundingGroup::EXCLUDE_BBOX, group, Gui::SoSkipBoundingGroup::INCLUDE_BBOX, and Gui::SoSkipBoundingGroup::mode.
Referenced by Gui::View3DInventorPy::fitAll(), Gui::View3DInventor::onMsg(), viewAll(), and Gui::View3DInventor::viewAll().
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.
Definition at line 1434 of file View3DInventorViewer.cpp.
References Gui::SoFCSelection::documentName, Gui::SelectionSingleton::isSelected(), Gui::SoFCSelection::objectName, Draft::select(), and Gui::Selection().
Referenced by Gui::View3DInventor::onMsg().
friend class NavigationStyle [friend] |
Definition at line 322 of file View3DInventorViewer.h.