57#define NULL_VEC Vector3(0,0,0)
58#define UNIT_VEC Vector3(0,1,0)
61#define WEM_PRINT(msg){ std::cout << msg << std::endl; };
63#define WEM_ERROR(msg){ WEM_PRINT("WEM ERROR: " << msg << " in file " << __FILE__ << ", line: " << __LINE__); };
65#define WEM_WARNING(msg){ WEM_PRINT("WEM WARNING: " << msg << " in file " << __FILE__ << ", line: " << __LINE__); };
67#define WEM_DEBUG(msg){ WEM_PRINT("WEM Debug: " << msg << " in file " << __FILE__ << ", line: " << __LINE__); };
70#define WEM_MODULE_ERROR(function, msg){ mlError(function) << whoAmI() << ": " << msg; };
72#define WEM_MODULE_WARNING(function, msg){ mlWarning(function) << whoAmI() << ": " << msg; };
74#define WEM_MODULE_INFO(function, msg){ mlInfo(function) << whoAmI() << ": " << msg; };
77#define NORMALIZE_VECTOR3(v) v.normalize()
193 shouldSaveNodeNormals =
true;
194 shouldSaveNodeColors =
true;
195 shouldSaveEdges =
true;
196 shouldSaveFaceNormals =
true;
197 shouldSavePVLs =
true;
213 progressField =
nullptr;
223 template <
typename DT>
226 template <
typename DT1,
typename DT2>
229 if (progressField && (
current > 0) && (
static_cast<int>(
current) % mod == 0))
231 progressField->setFloatValue(offset +
static_cast<float>(read)* ratio);
235 template <
typename DT>
252 vectorByteSize = (version > 4) ? 8 : 4;
const double WEM_NODE_VALENCE3_THRESHOLD
Angle threshold for nodes with valence 3 removal for default check (~70 degrees).
const double WEM_EPSILON
Epsilon value used in Vector3 comparisons.
const double WEM_NODE_VALENCE3_NEIGHBORHOOD_THRESHOLD
Angle threshold for nodes with valence 3 removal for neighborhood check (~50 degrees).
const double WEM_GOLDEN_PERIMETER
Golden perimeter.
const int WEM_VERSION
Current version of WEM library.
const unsigned int WEM_MAX_NUM_NODES
Maximum number of nodes for polygons.
const unsigned int WEM_DEFAULT_VALENCE
Default vector size of edge and face valence for nodes.
const std::string WEM_SINGLE_COLORED_FACES
Name of the PVL for faces where a value of -1 signals to use the nodes' PVL, all other values are to ...
const double WEM_LARGE_EPSILON
Epsilon value used in Vector3 comparisons when precision is an issue.
const unsigned int WEM_MAX_VALENCE
Maximum edge and face valence for nodes.
Field to encapsulate an increasing float value from range [0,1].
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
const int WEM_PATCH_ID_ALL
Patch Id meaning: all patches.
NodeRenderingModes
Enumeration of the node rendering modes. Note that these are 'mirrored' in the SoWEM part.
@ WEM_NODE_RENDERING_NORMAL
Only the nodes' positions are rendered.
@ WEM_NODE_RENDERING_EXTRA_HIGH
As 'high', but with positions on all edges.
@ WEM_NODE_RENDERING_HIGH
As 'normal', but with the faces' centroids.
PrimitiveValueListTypes
Enumeration of primitive value list types.
@ WEM_PRIMITIVE_VALUE_LIST_FACE
Face values.
@ WEM_PRIMITIVE_VALUE_LIST_EDGE
Edge values.
@ WEM_PRIMITIVE_VALUE_LIST_NODE
Node values.
OrientationTypes
Enumeration of orientation types.
@ WEM_ORIENTATION_INWARD
Orientation: outward normals (positive volume).
@ WEM_ORIENTATION_UNKNOWN
@ WEM_ORIENTATION_OUTWARD
Orientation: unknown.
TriangulationModes
Enumeration of the triangulation modes. Note that these are 'mirrored' in the SoWEM part.
@ WEM_TRIANGULATION_FAN
A triangle fan is created out of the face.
@ WEM_TRIANGULATION_CENTER
A new node is created at the center of the face.
@ WEM_TRIANGULATION_STRIP
A triangle strip is created out of the face.
BoundingBoxModes
Enumeration of bounding box visualization. Note that these are 'mirrored' in the SoWEM part.
@ WEM_BOUNDING_BOX_OBJECT_ALIGNED
Object aligned (PCA) bounding box.
@ WEM_BOUNDING_BOX_AXIS_ALIGNED
Axis aligned bounding box.
ColorModes
Enumeration of the color modes. Note that these are 'mirrored' in the SoWEM part.
@ WEM_COLOR_GENERAL
A general color is taken for the whole WEM.
@ WEM_COLOR_LUT_VALUES
The nodes' LUT values are taken to read out the color of a LUT.
@ WEM_COLOR_TEXTURED
The nodes' are textured using textureS and textureT primitive value lists.
@ WEM_COLOR_NODE_COLORS
The nodes' colors are takes for coloring.
@ WEM_COLOR_LUT_VALUES_INTEGER
The nodes' LUT values are taken to read out the color of an integer LUT.
@ WEM_COLOR_NONE
No internal SoMaterial node is used in the output scene.
WEMUpdateMode
Defines the update modes of WEM modules.
@ AutoUpdate
Module computes anew on any input change.
@ AutoClear
Module clears its output on any input change (output WEM is empty).
@ Off
Module does not react on input change, output WEM remains.
PatchTypes
Enumeration of mesh types.
@ WEM_PATCH_POLYGONS
Patch type: the faces can be n-polygons with up to WEM_MAX_NUM_NODES.
@ WEM_PATCH_TRIANGLES
Patch type: all faces are triangles.
@ WEM_PATCH_QUADS
Patch type: all faces are quads.
@ WEM_PATCH_UNKNOWN
Patch type: the type of the faces is unknown.
WEMNotificationType
Defines the available WEM notifications.
@ WEM_NOTIFICATION_FINISHED
Notification flag: an interaction on a part has been finished.
@ WEM_NOTIFICATION_INTERACTION_INIT
Notification flag: an interaction module needs initialization.
@ WEM_NOTIFICATION_NONE
Notification flag: no notification at all (for initializing).
@ WEM_NOTIFICATION_SELECTION
Notification flag: a part has been selected.
@ WEM_NOTIFICATION_REPAINT
Notification flag: a part needs a repainting.
Structure to gather persistence parameters.
WEMPersistenceParameters()
bool shouldSaveFaceNormals
bool shouldSaveNodeColors
bool shouldSaveNodeNormals
Helper struct for updating the progress bar while loading/saving.
ProgressField * progressField
void update(DT1 current, DT2 read)
WEMProgressUpdater(ProgressField *pf, float r, float o)
Helper struct for bundling parameters to keep method interfaces small.
WEMReadParameters(size_t wemVersion)