35 #ifndef ANA_WINDOW3D_WINDOW3D_H
36 #define ANA_WINDOW3D_WINDOW3D_H
53 class GLWidgetManager;
54 class OrientationAnnotation;
63 #if QT_VERSION >= 0x060000
119 Qt::WindowFlags f = Qt::WindowFlags() );
126 bool temporaryObject =
false,
144 std::vector<float> &texvalue, std::string & textype,
145 Point3df & positionNearestVertex,
int* indexNearestVertex,
146 std::vector<std::string> & texlabels );
154 std::vector<float> &texvalue, std::string & textype,
155 Point3df & positionNearestVertex,
int* indexNearestVertex,
156 std::vector<std::string> & texlabels );
164 const std::vector<std::string> & constraintList,
int constraintType,
204 #
if QT_VERSION >= 0x060000
205 QOpenGLWidget* glw = 0,
bool with3d =
false );
207 QGLWidget* glw = 0,
bool with3d = false );
228 std::vector<float> & bmax )
const;
256 #if QT_VERSION >= 0x060000
257 const QOpenGLWidget * shareWidget, Qt::WindowFlags f );
259 const QGLWidget * shareWidget, Qt::WindowFlags f );
281 std::list<anatomist::AObject *> & opaque )
const;
374 const std::vector<float> & bmax );
Functions that can modify on-the-fly display primitives of an object.
virtual ~ObjectModifier()
ObjectModifier(AWindow3D *w)
virtual void modify(anatomist::AObject *, anatomist::GLPrimitives &)=0
3D window, OpenGL rendering
virtual void showToolBars(int state=2)
Shows or hides all tools (menu, toolbars) around the main view area.
virtual std::list< anatomist::AObject * > * objectsAtCursorPosition(int x, int y, int tolerenceRadius)
pick several objects at the cursor 2D position
virtual const std::string & baseTitle() const
void setVisibleSurfpaint(bool b)
bool isViewOblique() const
void refreshTemp()
Redraws temporary objects only.
virtual std::set< unsigned > & typeCount()
static void setGLWidgetCreator(GLWidgetCreator)
hook to create inherited QAGLWidgets (Vtk-enabled for instance)
void setFlatShading(bool)
void sliderChanged(int dim, int slice)
float clipDistance() const
void setClipMode(ClipMode m)
int getSliceSliderPosition()
ViewType viewType() const
void setOrientationCube(bool state)
Compass handling methods.
void syncViews(bool keepextrema=false)
void registerObjectModifier(ObjectModifier *mod)
Allows changing display lists from normal objects DLists.
bool cullingEnabled() const
virtual void unregisterObject(anatomist::AObject *obj)
bool hasBoundingFrame() const
bool constraintEditorIsActive()
virtual const std::set< unsigned > & typeCount() const
void enablePerspective(bool)
void setRenderingMode(RenderingMode mode)
Rendering mode (normal, wireframe, fast)
void renderSelectionBuffer(anatomist::ViewState::glSelectRenderMode mode, const anatomist::AObject *selectedobject=0)
QImage snapshotImage(int width=0, int height=0, int bufmode=0)
Get a snapshot of the window, after a refresh if needed.
AWindow3D * leftEyeWindow()
virtual void registerObject(anatomist::AObject *obj, bool temporaryObject=false, int position=-1)
int getConstraintType() const
void updateObject(anatomist::AObject *obj, anatomist::PrimList *pl=0, anatomist::ViewState::glSelectRenderMode selectmode=anatomist::ViewState::glSELECTRENDER_NONE)
bool surfpaintIsVisible()
anatomist::GLWidgetManager *(* GLWidgetCreator)(anatomist::AWindow *win, QWidget *parent, const char *name, const QGLWidget *shareWidget, Qt::WindowFlags f)
int getSliceSliderMaxPosition()
std::list< anatomist::AObject * >::iterator processRenderingOrder(std::list< anatomist::AObject * > &opaque) const
calculates the objects rendering order, according to various constraints (opaque/transparent,...
virtual void setPosition(const std::vector< float > &position, const anatomist::Referential *orgref)
virtual anatomist::AObject * objectAtCursorPosition(int x, int y)
pick the object at the cursor 2D position
int getTimeSliderMaxPosition()
void enableToolTips(bool)
void updateObject2D(anatomist::AObject *obj, anatomist::PrimList *pl=0, anatomist::ViewState::glSelectRenderMode selectmode=anatomist::ViewState::glSELECTRENDER_NONE)
virtual int polygonAtCursorPosition(int x, int y, const anatomist::AObject *obj)
pick a polygon on a selected object at the cursor 2D position
anatomist::AObject * getConstraintTexture()
bool hasOrientationCube() const
void setPolygonsSortingEnabled(bool)
void setActiveConstraintEditor(bool b)
static anatomist::Geometry setupWindowGeometry(const std::list< carto::shared_ptr< anatomist::AObject > > &objects, const aims::Quaternion &slicequat, const anatomist::Referential *wref=0, QGLWidget *glw=0, bool with3d=false)
void saveSnapshotWithCustomSize()
bool inAutoFusion(const anatomist::AObject *obj) const
void resizeEvent(QResizeEvent *)
void loadConstraintData(const std::vector< std::string > &constraintList, int constraintType, anatomist::AObject *texConstraint)
const aims::Quaternion & sliceQuaternion() const
void unregisterObjectModifier(ObjectModifier *mod)
void renderAfter(anatomist::AObject *obj, anatomist::AObject *afterthis)
adds a rendering order constraint: obj will be rendered immediately after afterthis.
void printPositionAndValue()
virtual void sortPolygons(bool force=false)
AWindow3D(ViewType t=Oblique, QWidget *parent=0, carto::Object params=carto::none(), Qt::WindowFlags f=Qt::WindowFlags())
void getInfos3DFromClickPoint(int x, int y, Point3df &position, int *poly, anatomist::AObject *objselect, std::string &objtype, std::vector< float > &texvalue, std::string &textype, Point3df &positionNearestVertex, int *indexNearestVertex, std::vector< std::string > &texlabels)
virtual void setPosition(const Point3df &position, const anatomist::Referential *orgref)
Set position of cursor.
AWindow3D * rightEyeWindow()
virtual void setReferential(anatomist::Referential *ref)
QSlider * getSliceSlider(void) const
void toggleStatusBarVisibility()
int computeNearestVertexFromPolygonPoint(const anatomist::ViewState &vs, int poly, const anatomist::GLComponent *glc, const Point3df &position, Point3df &positionNearestVertex)
print all infos about vertex picked on a polygon selected
void orientationChanged()
virtual SubType subtype() const
void setBoundingFrame(bool state)
Frame handling methods.
void setRightEyeWindow(AWindow3D *)
int getTimeSliderPosition()
virtual void updateWindowGeometry()
adapts geometry to the current contents and referential
void changeTimeSliders(int, int)
void renderBefore(anatomist::AObject *obj, anatomist::AObject *beforethis)
adds a rendering order constraint: obj will be rendered immediately before beforethis.
virtual void setViewType(ViewType t)
Mute into a new view type (Axial, Sagittal, Coronal or Oblique)
bool toopTipsEnabled() const
void setPolygonsSortingDirection(bool dir)
void setTimeSliderPosition(int position)
void updateObject3D(anatomist::AObject *obj, anatomist::PrimList *pl=0, anatomist::ViewState::glSelectRenderMode selectmode=anatomist::ViewState::glSELECTRENDER_NONE)
virtual void update(const Observable *obs, void *)
std::vector< std::string > getConstraintList()
static std::string _baseTitle
anatomist::GLPrimitives cursorGLL() const
bool polygonsSortingEnabled() const
void setAutoRotationCenter()
void setViewPoint(float *quaternion, const float zoom)
set the view of the scene
ClipMode clipMode() const
virtual void showStatusBar(int state=2)
std::string displayInfoAtClickPositionAsText(int x, int y, bool html=false)
void displayClickPos(Point3df clickPos)
Display the click point.
void getInfos3DFromPosition(const std::vector< float > &position, int poly, anatomist::AObject *objselect, std::string &objtype, std::vector< float > &texvalue, std::string &textype, Point3df &positionNearestVertex, int *indexNearestVertex, std::vector< std::string > &texlabels)
same as above but from a 3+D position.
bool linkedCursorOnSliderChange() const
void resizeView(int w, int h)
Tries to resize the viewing area to given size.
virtual Type type() const
Get the window type (2D, 3D or control)
virtual bool positionFromCursor(int x, int y, Point3df &pos)
Translates mouse position to Anatomist geometry position.
void setClipDistance(float d)
void setLinkedCursorPos()
void setSliceQuaternion(const aims::Quaternion &q)
virtual carto::rc_ptr< anatomist::ViewState > viewState()
bool perspectiveEnabled() const
void setupTimeSlider(const std::vector< float > &bmin, const std::vector< float > &bmax)
void setSliceSliderPosition(int position)
void setLeftEyeWindow(AWindow3D *)
void displayInfoAtClickPosition(int x, int y)
void setLinkedCursorOnSliderChange(bool x)
void setupSliceSlider(float mins, float maxs)
void enableTransparentZ(bool)
bool boundingBox(std::vector< float > &bmin, std::vector< float > &bmax) const
Get bounding box in N-dimension mode (new in anatomist 4.6)
RenderingMode renderingMode() const
void updateViewTypeToolBar()
virtual void refreshNow()
Refresh the window (redraw the contained objects).
void refreshLightViewNow()
void updateLeftRightAnnotations()
void setLight(const anatomist::Light &light)
bool transparentZEnabled() const
void setSliceOrientation(const Point3df &normal)
void refreshLightView()
Only redraws existing objects (in most cases, just calls existing OpenGL lists, except for observer-d...
virtual void displayClickPoint()
bool polygonsSortingDirection() const
returns false for back-to-front, true for front-to-back
void removeFromAutoFusion2D(anatomist::AObject *obj)
delete or modify the auto Fusion2D object when removing an object
bool autoFusion2D(anatomist::AObject *obj)
build or modify the auto Fusion2D object when adding a new object.
virtual const anatomist::View * view() const
virtual anatomist::View * view()
static std::set< unsigned > _count3d
3D windows static counter
anatomist::Light * light()
Anatomist Window using Qt and controler system, providing a toolbar for controls.
Base Anatomist object (abstract)
Abstract base class Anatomist window.
Base class for all OpenGL objects in Anatomist (with OpenGL display lists)
Light used for OpenGL in 3D windows.
This class can be subclassed to represent an object that the programmer wants to have observed.
Referential: marker for transformations, with an associated color.
see http://doc.qt.digia.com/qq/qq26-openglcanvas.html
std::list< carto::rc_ptr< GLItem > > PrimList
std::list< RefGLItem > GLPrimitives
::sigc::trackable Observable
ViewState holds information about how a view wants to see an object.
@ glSELECTRENDER_NONE
no selection