MeVisLab Toolbox Reference
SoCSOCrossSectionRenderer.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2012, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13
15
16#pragma once
17
19
20
22
25{
26 SO_NODE_HEADER(SoCSOCrossSectionRenderer);
27
28public:
29
32
35 void draw(const CSODrawCSOInfos& csoInfos, const CSODrawView2DInfos& view2DInfos, const std::vector<CSODrawSliceInformation>& renderInfos, SoView2DCSOExtensibleEditor* editor) override;
36
38 static void initClass();
39
40 void createStartPressAt(const SoPointerPosition& ) override {}
41 void createDragMoveTo(const SoPointerPosition& ) override {}
42 bool createEndPress(int ) override { return false; }
44
47 SoPointingAction* selectAndMoveEndPress(int ) override { return nullptr; }
48
49 int cursorShape() const override { return SoViewerProxy::DEFAULT_CURSOR; }
50
51 bool shouldRenderGeneral(ml::CSO*) const override { return false; }
52
58
60 {
62 {
63 x = y = -1;
64 }
65 float x,y;
66 };
67
68protected:
69
70private:
71
72 struct CSOCrossings
73 {
74 CSOCrossings()
75 {
76 cso = nullptr;
77 sorted = false;
78 }
79 std::vector < CrossingPoint > crossingPoints;
80 ml::CSO* cso;
81 bool sorted;
82 };
83
84 std::vector<CSOCrossings> crossings;
85
86 bool intersectionSegmentPlane(const ml::Vector3& segmentPoint1, const ml::Vector3& segmentPoint2,
88 SbVec3f& intersectionPoint);
89
90 void glDrawRect(float startX, float startY, float endX, float endY, float lineWidth);
91};
92
#define SOCSO_EXPORT
Header file for system independent resolution.
Definition SoCSOSystem.h:21
Extension for rendering CSOs in their cross-section.
void selectAndMoveStartPressAt(const SoPointerPosition &) override
void selectAndMoveDragMoveTo(const SoPointerPosition &) override
SoCSOCrossSectionRenderer()
Standard constructor.
void createStartPressAt(const SoPointerPosition &) override
static void initClass()
init class in inventor runtime
SoPointingAction * selectAndMoveEndPress(int) override
void createDragMoveTo(const SoPointerPosition &) override
void pointerPositionIfAllowedAt(const SoPointerPosition &) override
Sets seed points while moving the mouse – but not while dragging.
bool shouldRenderGeneral(ml::CSO *) const override
Returns whether a given CSO should be rendered by this general extension.
int cursorShape() const override
Returns the cursor shape that indicates the next creation.
void draw(const CSODrawCSOInfos &, const CSODrawView2DInfos &, const CSODrawSliceInformation &, SoView2DCSOExtensibleEditor *) override
Drawing routine.
void draw(const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, const std::vector< CSODrawSliceInformation > &renderInfos, SoView2DCSOExtensibleEditor *editor) override
Base class for extensions that render all CSOs of a CSOList.
SoPointerPosition manages the current position of the mouse cursor.
SoPointingAction is the base class for any mouse based interaction.
The CSO represents a contour segmentation object.
Definition CSO.h:44
Target mlrange_cast(Source arg)
Generic version of checked ML casts.