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) 95 typedef std::shared_ptr<Reports> ReportsPtr;
104 const prtx::Shape::ReportBoolVect& boolReps,
105 const prtx::Shape::ReportFloatVect& floatReps,
106 const prtx::Shape::ReportStringVect& stringReps
112 void append(
const ReportsPtr& r);
114 prtx::Shape::ReportBoolVect mBools;
115 prtx::Shape::ReportFloatVect mFloats;
116 prtx::Shape::ReportStringVect mStrings;
121 typedef std::shared_ptr<EncodePreparator> EncodePreparatorPtr;
166 typedef std::vector<FinalizedInstance> InstanceVector;
184 static EncodePreparatorPtr create(
185 bool enforceTextureConsistency,
186 NamePreparator& namePreparator,
187 const NamePreparator::NamespacePtr& nsMeshes,
188 const NamePreparator::NamespacePtr& nsMaterials,
209 const ReportsPtr& reports = ReportsPtr()
226 size_t initialShapeIndex
236 static uint32_t getInitialShapePseudoShapeId(
size_t initialShapeIndex);
253 virtual void fetchFinalizedInstances(
254 InstanceVector& instances,
270 virtual uint64_t getUsedMem(
bool considerInstanceCounts =
false)
const = 0;
275 virtual void clear() = 0;
286 uint32_t mInitialShapeIndex;
288 std::vector<uint32_t> mMeshProperties;
306 ALL_MESH_FACES_CONVEX = 1 << 0,
307 ALL_MESH_FACES_PLANAR = 1 << 1
315 static const uint32_t NO_INITIAL_SHAPE_INDEX = uint32_t(-1);
316 static const uint32_t NO_SHAPE_ID = uint32_t(-1);
317 static const int32_t NO_PROTOTYPE_INDEX = -1;
349 const std::wstring& getInitialShapeName()
const;
354 const std::wstring& getShapeName()
const;
359 uint32_t getInitialShapeIndex()
const;
364 uint32_t getShapeId()
const;
372 int32_t getPrototypeIndex()
const;
380 bool allMeshFacesConvex(
size_t meshIndex)
const;
388 bool allMeshFacesPlanar(
size_t meshIndex)
const;
393 const ReportsPtr& getReports()
const;
415 INDICES_SEPARATE_FOR_ALL_VERTEX_ATTRIBUTES = 0,
420 INDICES_SAME_FOR_VERTICES_AND_NORMALS = (1 << 0),
425 INDICES_SAME_FOR_VERTICES_AND_FIRST_UV_SET = (1 << 1),
430 INDICES_SAME_FOR_VERTICES_AND_ALL_UV_SETS = (1 << 2) | INDICES_SAME_FOR_VERTICES_AND_FIRST_UV_SET,
435 INDICES_SAME_FOR_VERTICES_AND_NORMALS_AND_FIRST_UV_SET = INDICES_SAME_FOR_VERTICES_AND_NORMALS | INDICES_SAME_FOR_VERTICES_AND_FIRST_UV_SET,
440 INDICES_SAME_FOR_ALL_VERTEX_ATTRIBUTES = INDICES_SAME_FOR_VERTICES_AND_NORMALS | INDICES_SAME_FOR_VERTICES_AND_ALL_UV_SETS
454 [[deprecated(
"replaced by meshMerging")]]
PreparationFlags& mergeByMaterial(
bool v);
570 bool instancing()
const;
571 [[deprecated(
"replaced by meshMerging")]]
bool mergeByMaterial()
const;
573 bool cutoutTextures()
const;
574 bool createTextureAtlases()
const;
575 bool atlasRepeatingTextures()
const;
576 int maxAtlasDim()
const;
577 bool atlasAddWrapBorder()
const;
578 bool forceAtlasing()
const;
579 uint32_t maxTexSize()
const;
580 bool triangulate()
const;
581 const double* offset()
const;
584 bool mergeVertices()
const;
585 bool cleanupVertexNormals()
const;
586 bool cleanupUVs()
const;
587 float mergeToleranceVertices()
const;
588 float mergeToleranceNormals()
const;
589 float mergeToleranceUVs()
const;
590 IndexSharing indexSharing()
const;
591 bool determineMeshProperties()
const;
596 bool mCutoutTextures;
597 bool mCreateTextureAtlases;
598 bool mAtlasRepeatingTextures;
600 bool mAtlasAddWrapBorder;
602 uint32_t mMaxTexSize;
604 bool mDetermineMeshProperties;
606 bool mCleanupVertexNormals;
610 IndexSharing mIndexSharing;
611 float mMergeToleranceVertices;
612 float mMergeToleranceNormals;
613 float mMergeToleranceUVs;
623 # pragma warning(pop) Any missing vertex normals will be set to the corresponding face normal.
Definition: EncodePreparator.h:49
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
All non-instanced meshes of the same type are merged together.
Definition: EncodePreparator.h:74
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:411
Action
Definition: EncodePreparator.h:46
std::shared_ptr< std::wstring > StringPtr
shared std::string
Definition: Types.h:36
Definition: EncodePreparator.h:313
Meshes are not merged.
Definition: EncodePreparator.h:72
Action
Definition: EncodePreparator.h:71
Definition: EncodePreparator.h:162
The Procedural Runtime eXtension namespace. The prtx namespace contains the tools to extend the Proce...
Definition: AnnotationBuilder.h:35
Definition: EncodePreparator.h:280
Definition: /InitialShape.h:29
Definition: EncodePreparator.h:66
std::shared_ptr< Geometry > GeometryPtr
shared Geometry pointer
Definition: DebugUtils.h:37
Definition: Callbacks.h:270
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
Definition: EncodePreparator.h:406
Definition: EncodePreparator.h:42
Definition: EncodePreparator.h:54
Definition: EncodePreparator.h:100
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:305
Definition: Material.h:306