MeVisLab Toolbox Reference
CSOTrailRenderer.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2014, 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
18#include <mlVector3.h>
19#include <vector>
20#include <SoCSOSystem.h>
22
23class SbVec3f;
24class SbVec2f;
25class SbColor;
26
28
31namespace SoCSOEditorTools
32{
33 struct LineRenderSettings;
34}
35
38{
40 {
41 csoPointsIndex = 0;
42 trailPointsIndex = 0;
43 }
47};
48typedef std::vector<CSOTrailIntersection> CSOTrailIntersections;
49
50
52{
53public:
54
55 typedef std::vector<ml::Vector3> TrailT;
56
58
59 const TrailT& getTrail() const;
61 bool hasTrail() const;
62 bool hasTrailWithArea() const;
63 bool isInPlane() const;
66 std::vector<ml::Vector3>& getTrailVoxelSpace();
67 std::vector<ml::Vector3>& getSmoothedTrailVoxelSpace();
68
69 void addToTrail(const SbVec3f& position);
70 void clearTrail();
71
72 void setWorldToVoxelMatrix(const ml::Matrix4& worldToVoxelMatrix);
73
74 // note: renderSetting attributes outlineColor and outlineAlpha are currently not considered
76 void setBackGLForTrail() const;
77
78 void drawTrail(const CSODrawView2DInfos& view2DInfos, SoView2DCSOExtensibleEditor* editor, bool closeTrail=true) const;
79
85
88
89protected:
92
100};
std::vector< CSOTrailIntersection > CSOTrailIntersections
#define SOCSO_EXPORT
Header file for system independent resolution.
Definition SoCSOSystem.h:21
ml::Matrix4 _worldToVoxelMatrix
TrailT _smoothedTrailPositionsVoxelSpace
bool hasTrailWithArea() const
static void smoothPositions(const TrailT &inputPositions, TrailT &smoothedTrail)
Smooths the given vector of positions by a Laplacian smoothing.
void addToTrail(const SbVec3f &position)
void setWorldToVoxelMatrix(const ml::Matrix4 &worldToVoxelMatrix)
void convertSbVec3fToVector3(const SbVec3f &original, ml::Vector3 &copy) const
void setupGLForTrail(const SoCSOEditorTools::LineRenderSettings &renderSettings) const
ml::CSOBoundingBox _projectedTrailVoxelBoundingBox
bool isInPlane() const
ml::CSOBoundingBox getVoxelBoundingBox()
std::vector< ml::Vector3 > TrailT
void computeVoxelSpaceProperties()
void drawTrail(const CSODrawView2DInfos &view2DInfos, SoView2DCSOExtensibleEditor *editor, bool closeTrail=true) const
ml::Vector3 getTrailNormal() const
std::vector< ml::Vector3 > & getTrailVoxelSpace()
bool _shouldRecomputeVoxelSpaceProperties
ml::CSOBoundingBox getProjectedVoxelBoundingBox()
TrailT _trailPositionsVoxelSpace
const TrailT & getTrail() const
bool hasTrail() const
std::vector< ml::Vector3 > & getSmoothedTrailVoxelSpace()
static bool segmentsArePossiblyCrossing(const ml::Vector3 &trailSegmentStart, const ml::Vector3 &trailSegmentEnd, const ml::Vector3 &csoSegmentStart, const ml::Vector3 &csoSegmentEnd)
Returns whether the given segments are potentially crossing each other.
void setBackGLForTrail() const
ml::CSOBoundingBox _voxelBoundingBox
Base class for an editor extension for the SoView2DCSOExtensibleEditor.
The CSOBoundingBox defines an axis parallel bounding box with double precision.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
Struct holding the CSO/trail point index and the computed intersection point.
ml::Vector3 intersectionPoint