MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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:
31
36 void draw(const CSODrawCSOInfos& csoInfos, const CSODrawView2DInfos& view2DInfos,
37 const std::vector<CSODrawSliceInformation>& renderInfos, SoView2DCSOExtensibleEditor* editor) override;
38
40 static void initClass();
41
43 {}
44 void createDragMoveTo(const SoPointerPosition&) override
45 {}
46 bool createEndPress(int) override
47 {
48 return false;
49 }
51 {}
52
54 {}
56 {}
58 {
59 return nullptr;
60 }
61
62 int cursorShape() const override
63 {
65 }
66
67 bool shouldRenderGeneral(ml::CSO*) const override
68 {
69 return false;
70 }
71
77
79 {
81 {
82 x = y = -1;
83 }
84 float x, y;
85 };
86
87protected:
88private:
89 struct CSOCrossings
90 {
91 CSOCrossings()
92 {
93 cso = nullptr;
94 sorted = false;
95 }
96 std::vector<CrossingPoint> crossingPoints;
97 ml::CSO* cso;
98 bool sorted;
99 };
100
101 std::vector<CSOCrossings> crossings;
102
103 bool intersectionSegmentPlane(const ml::Vector3& segmentPoint1, const ml::Vector3& segmentPoint2,
105 SbVec3f& intersectionPoint);
106
107 void glDrawRect(float startX, float startY, float endX, float endY, float lineWidth);
108};
109
#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.