MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
WEMSetOp.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, 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#pragma once
14
17
19
21
22const unsigned int WEMSETOP_OUTPUT_FIRST = 0;
23const unsigned int WEMSETOP_OUTPUT_SECOND = 1;
24const unsigned int WEMSETOP_OUTPUT_BOTH = 2;
25
27
28const unsigned int WEMSETOP_BOOLEAN_UNION = 0;
29const unsigned int WEMSETOP_BOOLEAN_INTERSECTION = 1;
30const unsigned int WEMSETOP_BOOLEAN_DIFFERENCE = 2;
31
33
34const unsigned int WEMSETOP_OUTER_FLAG = 1;
35const unsigned int WEMSETOP_INTERSECTING_FLAG = 5;
36
38
40namespace WEMSetOp
41{
43 enum Axis {
44 xAxis = 0,
46 zAxis
47 };
48
52 WEMVector<WEMCut>* cuts = nullptr);
53
57 WEMVector<WEMCut>* cuts = nullptr);
58
62 WEMVector<WEMCut>* cuts = nullptr);
63
64 // Not exporting the methods below to simulate their former private state
65
70
75
80
83 const Vector3& max2);
84
87
90 unsigned int boolOpMode, unsigned int outputMode);
91
94
105}; // namespace WEMSetOp
106
108
#define MLWEM_EXPORT
Definition MLWEMSystem.h:18
A class to administrate an axis coordinate system drawable in OpenGL.
Definition Axis.h:23
Defines the mesh component: node.
Definition WEMNode.h:33
Base class for triangle and quad patches.
Definition WEMPatch.h:61
This represents a WEMPatch consisting of triangles only.
Dynamic templated vector.
Definition WEMVector.h:27
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
void _performTrivialBoolOp(WEMTrianglePatch *inPatch1, WEMTrianglePatch *inPatch2, WEMTrianglePatch *outPatch, unsigned int boolOpMode, unsigned int outputMode)
If the bounding boxes of the input WEMs do not intersect, perform a trivial boolean operation.
void _removeNonValidCuts(WEMVector< WEMFace > *intersectedFaces, WEMVector< WEMFaceCut > **faceCuts)
Removes all non-valid face cuts from the common face cuts vector.
void _boolOp(WEMTrianglePatch *inPatch1, WEMTrianglePatch *inPatch2, WEMTrianglePatch *outPatch, unsigned int boolOpMode, unsigned int outputMode, TriangulationModes triangulationMode, WEMVector< WEMCut > *cuts)
Performs a boolean operation (union, intersection, difference) on given patches.
Axis _getMinimalOverlapAxisOfBoundingBoxes(const Vector3 &min1, const Vector3 &min2, const Vector3 &max1, const Vector3 &max2)
Returns the minimal overlap axis of the given bounding boxes.
WEMVector< WEMFaceCut > ** _setupFaceCuts(WEMTrianglePatch *inPatch, WEMVector< WEMFace > *intersectedFaces, WEMVector< WEMPartialFaceCut > **partialFaceCuts)
Sets up the face cut vector.
void _classifyIntersectionAndOutsideFaces(WEMTrianglePatch *inPatch1, WEMVector< WEMFace > *intersectedFaces)
Checks all faces; if a face if fully outside, it is just marked, else it is also added to the given i...
void _resetOuterAndIntersectingFlags(WEMTrianglePatch *inPatch1, WEMTrianglePatch *inPatch2)
Resets the status flags of nodes and faces.
void _updateClassification(WEMTrianglePatch *triPatch, WEMVector< WEMFaceCut > **faceCutTable, WEMTrianglePatch *rayPatch, WEMVector< WEMFace > *outerFaces=nullptr, WEMVector< WEMFace > *innerFaces=nullptr)
Updates classification of nodes and faces based on face cuts.
bool _areWEMBoundingBoxesIntersecting(WEMPatch *wemPatch1, WEMPatch *wemPatch2)
Returns whether the bounding boxes of the given WEMs are intersecting.
MLWEM_EXPORT void difference(WEMTrianglePatch *inPatch1, WEMTrianglePatch *inPatch2, WEMTrianglePatch *outPatch, unsigned int outputMode, TriangulationModes triangulationMode, WEMVector< WEMCut > *cuts=nullptr)
Returns the difference of the given patches.
void _addFacesToOutputPatch(WEMVector< WEMFace > *faces, WEMNode **nodeTable, WEMTrianglePatch *outPatch)
Adds the given faces to the output patch.
MLWEM_EXPORT void intersect(WEMTrianglePatch *inPatch1, WEMTrianglePatch *inPatch2, WEMTrianglePatch *outPatch, unsigned int outputMode, TriangulationModes triangulationMode, WEMVector< WEMCut > *cuts=nullptr)
Returns the intersection of the given patches.
bool _intersectBoundingBoxes(WEMTrianglePatch *triPatch1, WEMTrianglePatch *triPatch2)
Intersects bounding boxes of given patches.
MLWEM_EXPORT void unify(WEMTrianglePatch *inPatch1, WEMTrianglePatch *inPatch2, WEMTrianglePatch *outPatch, unsigned int outputMode, TriangulationModes triangulationMode, WEMVector< WEMCut > *cuts=nullptr)
Returns the union of the given patches.
const unsigned int WEMSETOP_BOOLEAN_DIFFERENCE
Set operation: difference.
Definition WEMSetOp.h:30
const unsigned int WEMSETOP_OUTPUT_SECOND
Output mode: second patch only.
Definition WEMSetOp.h:23
const unsigned int WEMSETOP_OUTPUT_BOTH
Output mode: both patches.
Definition WEMSetOp.h:24
const unsigned int WEMSETOP_INTERSECTING_FLAG
Definition WEMSetOp.h:35
TriangulationModes
Enumeration of the triangulation modes. Note that these are 'mirrored' in the SoWEM part.
const unsigned int WEMSETOP_OUTER_FLAG
Definition WEMSetOp.h:34
const unsigned int WEMSETOP_BOOLEAN_UNION
Set operation: union.
Definition WEMSetOp.h:28
const unsigned int WEMSETOP_BOOLEAN_INTERSECTION
Set operation: intersection.
Definition WEMSetOp.h:29
const unsigned int WEMSETOP_OUTPUT_FIRST
Output mode: first patch only.
Definition WEMSetOp.h:22