18 #ifndef PRTX_ENCODEPREPARATOR_H_ 19 #define PRTX_ENCODEPREPARATOR_H_ 21 #include "prt/Callbacks.h" 23 #include "prtx/NamePreparator.h" 24 #include "prtx/Shape.h" 25 #include "prtx/prtx.h" 28 # pragma warning(push) 29 # pragma warning(disable : 4275 4251) 111 typedef std::shared_ptr<Reports> ReportsPtr;
120 const prtx::Shape::ReportBoolVect& boolReps,
121 const prtx::Shape::ReportFloatVect& floatReps,
122 const prtx::Shape::ReportStringVect& stringReps
128 void append(
const ReportsPtr& r);
130 prtx::Shape::ReportBoolVect mBools;
131 prtx::Shape::ReportFloatVect mFloats;
132 prtx::Shape::ReportStringVect mStrings;
137 typedef std::shared_ptr<EncodePreparator> EncodePreparatorPtr;
201 static EncodePreparatorPtr create(
202 bool enforceTextureConsistency,
203 NamePreparator& namePreparator,
204 const NamePreparator::NamespacePtr& nsMeshes,
205 const NamePreparator::NamespacePtr& nsMaterials,
226 const ReportsPtr& reports = ReportsPtr()
243 size_t initialShapeIndex
253 static uint32_t getInitialShapePseudoShapeId(
size_t initialShapeIndex);
270 virtual void fetchFinalizedInstances(
287 virtual uint64_t getUsedMem(
bool considerInstanceCounts =
false)
const = 0;
292 virtual void clear() = 0;
303 uint32_t mInitialShapeIndex;
305 std::vector<uint32_t> mMeshProperties;
323 ALL_MESH_FACES_CONVEX = 1 << 0,
324 ALL_MESH_FACES_PLANAR = 1 << 1
332 static const uint32_t NO_INITIAL_SHAPE_INDEX = uint32_t(-1);
333 static const uint32_t NO_SHAPE_ID = uint32_t(-1);
334 static const int32_t NO_PROTOTYPE_INDEX = -1;
366 const std::wstring& getInitialShapeName()
const;
371 const std::wstring& getShapeName()
const;
376 uint32_t getInitialShapeIndex()
const;
381 uint32_t getShapeId()
const;
389 int32_t getPrototypeIndex()
const;
397 bool allMeshFacesConvex(
size_t meshIndex)
const;
405 bool allMeshFacesPlanar(
size_t meshIndex)
const;
410 const ReportsPtr& getReports()
const;
456 INDICES_SEPARATE_FOR_ALL_VERTEX_ATTRIBUTES = 0,
461 INDICES_SAME_FOR_VERTICES_AND_NORMALS = (1 << 0),
466 INDICES_SAME_FOR_VERTICES_AND_FIRST_UV_SET = (1 << 1),
471 INDICES_SAME_FOR_VERTICES_AND_ALL_UV_SETS = (1 << 2) | INDICES_SAME_FOR_VERTICES_AND_FIRST_UV_SET,
476 INDICES_SAME_FOR_VERTICES_AND_NORMALS_AND_FIRST_UV_SET = INDICES_SAME_FOR_VERTICES_AND_NORMALS | INDICES_SAME_FOR_VERTICES_AND_FIRST_UV_SET,
481 INDICES_SAME_FOR_ALL_VERTEX_ATTRIBUTES = INDICES_SAME_FOR_VERTICES_AND_NORMALS | INDICES_SAME_FOR_VERTICES_AND_ALL_UV_SETS
491 [[deprecated(
"replaced by instancingMode")]]
PreparationFlags& instancing(
bool v);
501 [[deprecated(
"replaced by meshMerging")]]
PreparationFlags& mergeByMaterial(
bool v);
623 [[deprecated(
"replaced by instancingMode")]]
bool instancing()
const;
625 [[deprecated(
"replaced by meshMerging")]]
bool mergeByMaterial()
const;
627 bool cutoutTextures()
const;
628 bool createTextureAtlases()
const;
629 bool atlasRepeatingTextures()
const;
630 int maxAtlasDim()
const;
631 bool atlasAddWrapBorder()
const;
632 bool forceAtlasing()
const;
633 uint32_t maxTexSize()
const;
634 bool triangulate()
const;
635 const double* offset()
const;
638 bool mergeVertices()
const;
639 bool cleanupVertexNormals()
const;
640 bool cleanupUVs()
const;
641 float mergeToleranceVertices()
const;
642 float mergeToleranceNormals()
const;
643 float mergeToleranceUVs()
const;
644 IndexSharing indexSharing()
const;
645 bool determineMeshProperties()
const;
646 bool bakeTextureTrafos()
const;
651 bool mCutoutTextures;
652 bool mCreateTextureAtlases;
653 bool mAtlasRepeatingTextures;
655 bool mAtlasAddWrapBorder;
657 uint32_t mMaxTexSize;
659 bool mDetermineMeshProperties;
661 bool mCleanupVertexNormals;
665 IndexSharing mIndexSharing;
666 float mMergeToleranceVertices;
667 float mMergeToleranceNormals;
668 float mMergeToleranceUVs;
670 bool mBakeTextureTrafos;
679 # pragma warning(pop) Any missing vertex normals will be set to the corresponding face normal.
Definition: EncodePreparator.h:49
Definition: EncodePreparator.h:78
Faces with holes are not modified.
Definition: EncodePreparator.h:59
Non-instanced meshes of the same type and with identical material attributes are merged together...
Definition: EncodePreparator.h:73
Definition: BoundingBox.h:38
Action
Definition: EncodePreparator.h:86
All non-instanced meshes of the same type are merged together.
Definition: EncodePreparator.h:74
No instancing.
Definition: EncodePreparator.h:87
Faces with holes will be triangulated.
Definition: EncodePreparator.h:60
std::vector< double > DoubleVector
vector of double
Definition: Types.h:32
Holes will be converted to regular faces.
Definition: EncodePreparator.h:62
std::shared_ptr< Material > MaterialPtr
shared Material pointer
Definition: DataBackend.h:45
Any holes will be deleted.
Definition: EncodePreparator.h:61
IndexSharing
Definition: EncodePreparator.h:452
Action
Definition: EncodePreparator.h:46
std::shared_ptr< std::wstring > StringPtr
shared std::string
Definition: Types.h:36
Definition: EncodePreparator.h:330
Meshes are not merged.
Definition: EncodePreparator.h:72
Action
Definition: EncodePreparator.h:71
Definition: EncodePreparator.h:89
Definition: EncodePreparator.h:178
The Procedural Runtime eXtension namespace. The prtx namespace contains the tools to extend the Proce...
Definition: AnnotationBuilder.h:35
Definition: EncodePreparator.h:297
Definition: /InitialShape.h:29
All cached/identical meshes are treated as instances.
Definition: EncodePreparator.h:88
Definition: EncodePreparator.h:66
std::shared_ptr< Geometry > GeometryPtr
shared Geometry pointer
Definition: DebugUtils.h:37
Definition: Callbacks.h:299
std::vector< MaterialPtr > MaterialPtrVector
vector of shared Material pointers
Definition: DataBackend.h:46
All vertex normals will be replaced with the corresponding face normal.
Definition: EncodePreparator.h:50
The vertex normals are not modified.
Definition: EncodePreparator.h:47
std::shared_ptr< Shape > ShapePtr
shared pointer to a Shape
Definition: Shape.h:41
Definition: AttributeMap.h:32
Action
Definition: EncodePreparator.h:58
std::vector< FinalizedInstance > InstanceVector
Definition: EncodePreparator.h:181
Definition: EncodePreparator.h:447
Definition: EncodePreparator.h:42
Definition: EncodePreparator.h:54
Definition: EncodePreparator.h:116
The Procedural Runtime API namespace. The prt namespace contains the top level entry points into the ...
Definition: Annotation.h:24
The vertex normals are deleted.
Definition: EncodePreparator.h:48
MeshProperties
Definition: EncodePreparator.h:322
Definition: Material.h:306