| OpenSubdiv

Loading...
Searching...
No Matches
topologyRefinerFactory.h
Go to the documentation of this file.
1//
2// Copyright 2014 DreamWorks Animation LLC.
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://opensubdiv.org/license.
6//
7#ifndef OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H
8#define OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H
9
10#include "../version.h"
11
12#include "../far/topologyRefiner.h"
13#include "../far/error.h"
14
15#include <cassert>
16
17 namespace OpenSubdiv {
18 namespace OPENSUBDIV_VERSION {
19
20 namespace Far {
21
29//
30 class TopologyRefinerFactoryBase {
31 protected:
32
33 //
34 // Protected methods invoked by the subclass template to verify and process each
35 // stage of construction implemented by the subclass:
36 //
37 typedef Vtr::internal::Level::ValidationCallback TopologyCallback;
38
39 static bool prepareComponentTopologySizing(TopologyRefiner& refiner);
40 static bool prepareComponentTopologyAssignment(TopologyRefiner& refiner, bool fullValidation,
41 TopologyCallback callback, void const * callbackData);
42 static bool prepareComponentTagsAndSharpness(TopologyRefiner& refiner);
43 static bool prepareFaceVaryingChannels(TopologyRefiner& refiner);
44};
45
46
60 template <class MESH>
61 class TopologyRefinerFactory : public TopologyRefinerFactoryBase {
62
63 public:
64
67 struct Options {
68
69 Options(Sdc::SchemeType sdcType = Sdc::SCHEME_CATMARK, Sdc::Options sdcOptions = Sdc::Options()) :
70 schemeType(sdcType),
71 schemeOptions(sdcOptions),
72 validateFullTopology(false) { }
73
74 Sdc::SchemeType schemeType;
75 Sdc::Options schemeOptions;
77 unsigned int validateFullTopology : 1;
80 };
81
91 //
96 static TopologyRefiner* Create(MESH const& mesh, Options options = Options());
97
111 static TopologyRefiner* Create(TopologyRefiner const & baseLevel);
112
113 protected:
114 typedef Vtr::internal::Level::TopologyError TopologyError;
115
117
132
134 static bool resizeComponentTopology(TopologyRefiner& newRefiner, MESH const& mesh);
135
138 static bool assignComponentTopology(TopologyRefiner& newRefiner, MESH const& mesh);
139
141 static bool assignComponentTags(TopologyRefiner& newRefiner, MESH const& mesh);
142
144 static bool assignFaceVaryingTopology(TopologyRefiner& newRefiner, MESH const& mesh);
145
147 static void reportInvalidTopology(TopologyError errCode, char const * msg, MESH const& mesh);
148
150
151 protected:
153
170
172 static void setNumBaseVertices(TopologyRefiner & newRefiner, int count);
173
175 static void setNumBaseFaces(TopologyRefiner & newRefiner, int count);
176
178 static void setNumBaseEdges(TopologyRefiner & newRefiner, int count);
179
181 static void setNumBaseFaceVertices(TopologyRefiner & newRefiner, Index f, int count);
182
184 static void setNumBaseEdgeFaces(TopologyRefiner & newRefiner, Index e, int count);
185
187 static void setNumBaseVertexFaces(TopologyRefiner & newRefiner, Index v, int count);
188
190 static void setNumBaseVertexEdges(TopologyRefiner & newRefiner, Index v, int count);
191
192 static int getNumBaseVertices(TopologyRefiner const & newRefiner);
193 static int getNumBaseFaces(TopologyRefiner const & newRefiner);
194 static int getNumBaseEdges(TopologyRefiner const & newRefiner);
196
198
220
222 static IndexArray getBaseFaceVertices(TopologyRefiner & newRefiner, Index f);
223
225 static IndexArray getBaseFaceEdges(TopologyRefiner & newRefiner, Index f);
226
228 static IndexArray getBaseEdgeVertices(TopologyRefiner & newRefiner, Index e);
229
231 static IndexArray getBaseEdgeFaces(TopologyRefiner & newRefiner, Index e);
232
234 static IndexArray getBaseVertexFaces(TopologyRefiner & newRefiner, Index v);
235
237 static IndexArray getBaseVertexEdges(TopologyRefiner & newRefiner, Index v);
238
240 static LocalIndexArray getBaseVertexFaceLocalIndices(TopologyRefiner & newRefiner, Index v);
242 static LocalIndexArray getBaseVertexEdgeLocalIndices(TopologyRefiner & newRefiner, Index v);
244 static LocalIndexArray getBaseEdgeFaceLocalIndices(TopologyRefiner & newRefiner, Index e);
245
247 static void populateBaseLocalIndices(TopologyRefiner & newRefiner);
248
250 static void setBaseEdgeNonManifold(TopologyRefiner & newRefiner, Index e, bool b);
251
253 static void setBaseVertexNonManifold(TopologyRefiner & newRefiner, Index v, bool b);
255
257
266
268 static Index findBaseEdge(TopologyRefiner const & newRefiner, Index v0, Index v1);
269
271 static void setBaseEdgeSharpness(TopologyRefiner & newRefiner, Index e, float sharpness);
272
274 static void setBaseVertexSharpness(TopologyRefiner & newRefiner, Index v, float sharpness);
275
277 static void setBaseFaceHole(TopologyRefiner & newRefiner, Index f, bool isHole);
279
281
291
293 static int createBaseFVarChannel(TopologyRefiner & newRefiner, int numValues);
294
296 static int createBaseFVarChannel(TopologyRefiner & newRefiner, int numValues, Sdc::Options const& fvarOptions);
297
299 static IndexArray getBaseFaceFVarValues(TopologyRefiner & newRefiner, Index face, int channel = 0);
300
302
303 protected:
304 //
305 // Not to be specialized:
306 //
307 static bool populateBaseLevel(TopologyRefiner& refiner, MESH const& mesh, Options options);
308
309 private:
310 //
311 // An oversight in the interfaces of the error reporting function between the factory
312 // class and the Vtr::Level requires this adapter function to avoid warnings.
313 //
314 // The static class method requires a reference as the MESH argument, but the interface
315 // for Vtr::Level requires a pointer (void*). So this adapter with a MESH* argument is
316 // used to effectively cast the function pointer required by Vtr::Level error reporting:
317 //
318 static void reportInvalidTopologyAdapter(TopologyError errCode, char const * msg, MESH const * mesh) {
319 reportInvalidTopology(errCode, msg, *mesh);
320 }
321};
322
323
324//
325// Generic implementations:
326//
327 template <class MESH>
328TopologyRefiner*
329 TopologyRefinerFactory<MESH>::Create(MESH const& mesh, Options options) {
330
331 TopologyRefiner * refiner = new TopologyRefiner(options.schemeType, options.schemeOptions);
332
333 if (! populateBaseLevel(*refiner, mesh, options)) {
334 delete refiner;
335 return 0;
336 }
337
338 // Eventually want to move the Refiner's inventory initialization here. Currently it
339 // is handled after topology assignment, but if the inventory is to include additional
340 // features (e.g. holes, etc.) it is better off deferred to here.
341
342 return refiner;
343}
344
345 template <class MESH>
346 TopologyRefiner*
347 TopologyRefinerFactory<MESH>::Create(TopologyRefiner const & source) {
348
349 return new TopologyRefiner(source);
350}
351
352 template <class MESH>
353 bool
354 TopologyRefinerFactory<MESH>::populateBaseLevel(TopologyRefiner& refiner, MESH const& mesh, Options options) {
355
356 //
357 // Construction of a specialized topology refiner involves four steps, each of which
358 // involves a method specialized for MESH followed by one that takes an action in
359 // response to it or in preparation for the next step.
360 //
361 // Both the specialized methods and those that follow them may find fault in the
362 // construction and trigger failure at any time:
363 //
364
365 //
366 // Sizing of the topology -- this is a required specialization for MESH. This defines
367 // an inventory of all components and their relations that is used to allocate buffers
368 // to be efficiently populated in the subsequent topology assignment step.
369 //
370 if (! resizeComponentTopology(refiner, mesh)) return false;
371 if (! prepareComponentTopologySizing(refiner)) return false;
372
373 //
374 // Assignment of the topology -- this is a required specialization for MESH. If edges
375 // are specified, all other topological relations are expected to be defined for them.
376 // Otherwise edges and remaining topology will be completed from the face-vertices:
377 //
378 bool validate = options.validateFullTopology;
379 TopologyCallback callback = reinterpret_cast<TopologyCallback>(reportInvalidTopologyAdapter);
380 void const * userData = &mesh;
381
382 if (! assignComponentTopology(refiner, mesh)) return false;
383 if (! prepareComponentTopologyAssignment(refiner, validate, callback, userData)) return false;
384
385 //
386 // User assigned and internal tagging of components -- an optional specialization for
387 // MESH. Allows the specification of sharpness values, holes, etc.
388 //
389 if (! assignComponentTags(refiner, mesh)) return false;
390 if (! prepareComponentTagsAndSharpness(refiner)) return false;
391
392 //
393 // Defining channels of face-varying primvar data -- an optional specialization for MESH.
394 //
395 if (! assignFaceVaryingTopology(refiner, mesh)) return false;
396 if (! prepareFaceVaryingChannels(refiner)) return false;
397
398 return true;
399}
400
401 template <class MESH>
402 inline void
403 TopologyRefinerFactory<MESH>::setNumBaseFaces(TopologyRefiner & newRefiner, int count) {
404 newRefiner._levels[0]->resizeFaces(count);
405}
406 template <class MESH>
407 inline void
408 TopologyRefinerFactory<MESH>::setNumBaseEdges(TopologyRefiner & newRefiner, int count) {
409 newRefiner._levels[0]->resizeEdges(count);
410}
411 template <class MESH>
412 inline void
413 TopologyRefinerFactory<MESH>::setNumBaseVertices(TopologyRefiner & newRefiner, int count) {
414 newRefiner._levels[0]->resizeVertices(count);
415}
416
417 template <class MESH>
418 inline int
419 TopologyRefinerFactory<MESH>::getNumBaseFaces(TopologyRefiner const & newRefiner) {
420 return newRefiner._levels[0]->getNumFaces();
421}
422 template <class MESH>
423 inline int
424 TopologyRefinerFactory<MESH>::getNumBaseEdges(TopologyRefiner const & newRefiner) {
425 return newRefiner._levels[0]->getNumEdges();
426}
427 template <class MESH>
428 inline int
429 TopologyRefinerFactory<MESH>::getNumBaseVertices(TopologyRefiner const & newRefiner) {
430 return newRefiner._levels[0]->getNumVertices();
431}
432
433 template <class MESH>
434 inline void
435 TopologyRefinerFactory<MESH>::setNumBaseFaceVertices(TopologyRefiner & newRefiner, Index f, int count) {
436 newRefiner._levels[0]->resizeFaceVertices(f, count);
437 newRefiner._hasIrregFaces = newRefiner._hasIrregFaces || (count != newRefiner._regFaceSize);
438}
439 template <class MESH>
440 inline void
441 TopologyRefinerFactory<MESH>::setNumBaseEdgeFaces(TopologyRefiner & newRefiner, Index e, int count) {
442 newRefiner._levels[0]->resizeEdgeFaces(e, count);
443}
444 template <class MESH>
445 inline void
446 TopologyRefinerFactory<MESH>::setNumBaseVertexFaces(TopologyRefiner & newRefiner, Index v, int count) {
447 newRefiner._levels[0]->resizeVertexFaces(v, count);
448}
449 template <class MESH>
450 inline void
451 TopologyRefinerFactory<MESH>::setNumBaseVertexEdges(TopologyRefiner & newRefiner, Index v, int count) {
452 newRefiner._levels[0]->resizeVertexEdges(v, count);
453}
454
455 template <class MESH>
456 inline IndexArray
457 TopologyRefinerFactory<MESH>::getBaseFaceVertices(TopologyRefiner & newRefiner, Index f) {
458 return newRefiner._levels[0]->getFaceVertices(f);
459}
460 template <class MESH>
461 inline IndexArray
462 TopologyRefinerFactory<MESH>::getBaseFaceEdges(TopologyRefiner & newRefiner, Index f) {
463 return newRefiner._levels[0]->getFaceEdges(f);
464}
465 template <class MESH>
466 inline IndexArray
467 TopologyRefinerFactory<MESH>::getBaseEdgeVertices(TopologyRefiner & newRefiner, Index e) {
468 return newRefiner._levels[0]->getEdgeVertices(e);
469}
470 template <class MESH>
471 inline IndexArray
472 TopologyRefinerFactory<MESH>::getBaseEdgeFaces(TopologyRefiner & newRefiner, Index e) {
473 return newRefiner._levels[0]->getEdgeFaces(e);
474}
475 template <class MESH>
476 inline IndexArray
477 TopologyRefinerFactory<MESH>::getBaseVertexFaces(TopologyRefiner & newRefiner, Index v) {
478 return newRefiner._levels[0]->getVertexFaces(v);
479}
480 template <class MESH>
481 inline IndexArray
482 TopologyRefinerFactory<MESH>::getBaseVertexEdges(TopologyRefiner & newRefiner, Index v) {
483 return newRefiner._levels[0]->getVertexEdges(v);
484}
485
486 template <class MESH>
487 inline LocalIndexArray
488 TopologyRefinerFactory<MESH>::getBaseEdgeFaceLocalIndices(TopologyRefiner & newRefiner, Index e) {
489 return newRefiner._levels[0]->getEdgeFaceLocalIndices(e);
490}
491 template <class MESH>
492 inline LocalIndexArray
493 TopologyRefinerFactory<MESH>::getBaseVertexFaceLocalIndices(TopologyRefiner & newRefiner, Index v) {
494 return newRefiner._levels[0]->getVertexFaceLocalIndices(v);
495}
496 template <class MESH>
497 inline LocalIndexArray
498 TopologyRefinerFactory<MESH>::getBaseVertexEdgeLocalIndices(TopologyRefiner & newRefiner, Index v) {
499 return newRefiner._levels[0]->getVertexEdgeLocalIndices(v);
500}
501
502 template <class MESH>
503 inline Index
504 TopologyRefinerFactory<MESH>::findBaseEdge(TopologyRefiner const & newRefiner, Index v0, Index v1) {
505 return newRefiner._levels[0]->findEdge(v0, v1);
506}
507
508 template <class MESH>
509 inline void
510 TopologyRefinerFactory<MESH>::populateBaseLocalIndices(TopologyRefiner & newRefiner) {
511 newRefiner._levels[0]->populateLocalIndices();
512}
513
514 template <class MESH>
515 inline void
516 TopologyRefinerFactory<MESH>::setBaseEdgeNonManifold(TopologyRefiner & newRefiner, Index e, bool b) {
517 newRefiner._levels[0]->setEdgeNonManifold(e, b);
518}
519 template <class MESH>
520 inline void
521 TopologyRefinerFactory<MESH>::setBaseVertexNonManifold(TopologyRefiner & newRefiner, Index v, bool b) {
522 newRefiner._levels[0]->setVertexNonManifold(v, b);
523}
524
525 template <class MESH>
526 inline void
527 TopologyRefinerFactory<MESH>::setBaseEdgeSharpness(TopologyRefiner & newRefiner, Index e, float s) {
528 newRefiner._levels[0]->getEdgeSharpness(e) = s;
529}
530 template <class MESH>
531 inline void
532 TopologyRefinerFactory<MESH>::setBaseVertexSharpness(TopologyRefiner & newRefiner, Index v, float s) {
533 newRefiner._levels[0]->getVertexSharpness(v) = s;
534}
535 template <class MESH>
536 inline void
537 TopologyRefinerFactory<MESH>::setBaseFaceHole(TopologyRefiner & newRefiner, Index f, bool b) {
538 newRefiner._levels[0]->setFaceHole(f, b);
539 newRefiner._hasHoles = newRefiner._hasHoles || b;
540}
541
542 template <class MESH>
543 inline int
544 TopologyRefinerFactory<MESH>::createBaseFVarChannel(TopologyRefiner & newRefiner, int numValues) {
545 return newRefiner._levels[0]->createFVarChannel(numValues, newRefiner._subdivOptions);
546}
547 template <class MESH>
548 inline int
549 TopologyRefinerFactory<MESH>::createBaseFVarChannel(TopologyRefiner & newRefiner, int numValues, Sdc::Options const& fvarOptions) {
550 Sdc::Options newOptions = newRefiner._subdivOptions;
551 newOptions.SetFVarLinearInterpolation(fvarOptions.GetFVarLinearInterpolation());
552 return newRefiner._levels[0]->createFVarChannel(numValues, newOptions);
553}
554 template <class MESH>
555 inline IndexArray
556 TopologyRefinerFactory<MESH>::getBaseFaceFVarValues(TopologyRefiner & newRefiner, Index face, int channel) {
557 return newRefiner._levels[0]->getFaceFVarValues(face, channel);
558}
559
560
561 template <class MESH>
562 bool
563 TopologyRefinerFactory<MESH>::resizeComponentTopology(TopologyRefiner& /* refiner */, MESH const& /* mesh */) {
564
565 Error(FAR_RUNTIME_ERROR,
566 "Failure in TopologyRefinerFactory<>::resizeComponentTopology() -- no specialization provided.");
567
568 //
569 // Sizing the topology tables:
570 // This method is for determining the sizes of the various topology tables (and other
571 // data) associated with the mesh. Once completed, appropriate memory will be allocated
572 // and an additional method invoked to populate it accordingly.
573 //
574 // The following methods should be called -- first those to specify the number of faces,
575 // edges and vertices in the mesh:
576 //
577 // void setBaseFaceCount( TopologyRefiner& newRefiner, int count)
578 // void setBaseEdgeCount( TopologyRefiner& newRefiner, int count)
579 // void setBaseVertexCount(TopologyRefiner& newRefiner, int count)
580 //
581 // and then for each face, edge and vertex, the number of its incident components:
582 //
583 // void setBaseFaceVertexCount(TopologyRefiner& newRefiner, Index face, int count)
584 // void setBaseEdgeFaceCount( TopologyRefiner& newRefiner, Index edge, int count)
585 // void setBaseVertexFaceCount(TopologyRefiner& newRefiner, Index vertex, int count)
586 // void setBaseVertexEdgeCount(TopologyRefiner& newRefiner, Index vertex, int count)
587 //
588 // The count/size for a component type must be set before indices associated with that
589 // component type can be used.
590 //
591 // Note that it is only necessary to size 4 of the 6 supported topological relations --
592 // the number of edge-vertices is fixed at two per edge, and the number of face-edges is
593 // the same as the number of face-vertices.
594 //
595 // So a single pass through your mesh to gather up all of this sizing information will
596 // allow the Tables to be allocated appropriately once and avoid any dynamic resizing as
597 // it grows.
598 //
599 return false;
600}
601
602 template <class MESH>
603 bool
604 TopologyRefinerFactory<MESH>::assignComponentTopology(TopologyRefiner& /* refiner */, MESH const& /* mesh */) {
605
606 Error(FAR_RUNTIME_ERROR,
607 "Failure in TopologyRefinerFactory<>::assignComponentTopology() -- no specialization provided.");
608
609 //
610 // Assigning the topology tables:
611 // Once the topology tables have been allocated, the six required topological
612 // relations can be directly populated using the following methods:
613 //
614 // IndexArray setBaseFaceVertices(TopologyRefiner& newRefiner, Index face)
615 // IndexArray setBaseFaceEdges(TopologyRefiner& newRefiner, Index face)
616 //
617 // IndexArray setBaseEdgeVertices(TopologyRefiner& newRefiner, Index edge)
618 // IndexArray setBaseEdgeFaces(TopologyRefiner& newRefiner, Index edge)
619 //
620 // IndexArray setBaseVertexEdges(TopologyRefiner& newRefiner, Index vertex)
621 // IndexArray setBaseVertexFaces(TopologyRefiner& newRefiner, Index vertex)
622 //
623 // For the last two relations -- the faces and edges incident a vertex -- there are
624 // also "local indices" that must be specified (considering doing this internally),
625 // where the "local index" of each incident face or edge is the index of the vertex
626 // within that face or edge, and so ranging from 0-3 for incident quads and 0-1 for
627 // incident edges. These are assigned through similarly retrieved arrays:
628 //
629 // LocalIndexArray setBaseVertexFaceLocalIndices(TopologyRefiner& newRefiner, Index vertex)
630 // LocalIndexArray setBaseVertexEdgeLocalIndices(TopologyRefiner& newRefiner, Index vertex)
631 // LocalIndexArray setBaseEdgeFaceLocalIndices( TopologyRefiner& newRefiner, Index edge)
632 //
633 // or, if the mesh is manifold, explicit assignment of these can be deferred and
634 // all can be determined by calling:
635 //
636 // void populateBaseLocalIndices(TopologyRefiner& newRefiner)
637 //
638 // All components are assumed to be locally manifold and ordering of components in
639 // the above relations is expected to be counter-clockwise.
640 //
641 // For non-manifold components, no ordering/orientation of incident components is
642 // assumed or required, but be sure to explicitly tag such components (vertices and
643 // edges) as non-manifold:
644 //
645 // void setBaseEdgeNonManifold(TopologyRefiner& newRefiner, Index edge, bool b);
646 //
647 // void setBaseVertexNonManifold(TopologyRefiner& newRefiner, Index vertex, bool b);
648 //
649 // Also consider using TopologyLevel::ValidateTopology() when debugging to ensure
650 // that topology has been completely and correctly specified.
651 //
652 return false;
653}
654
655 template <class MESH>
656 bool
657 TopologyRefinerFactory<MESH>::assignFaceVaryingTopology(TopologyRefiner& /* refiner */, MESH const& /* mesh */) {
658
659 //
660 // Optional assigning face-varying topology tables:
661 //
662 // Create independent face-varying primitive variable channels:
663 // int createBaseFVarChannel(TopologyRefiner& newRefiner, int numValues)
664 //
665 // For each channel, populate the face-vertex values:
666 // IndexArray setBaseFaceFVarValues(TopologyRefiner& newRefiner, Index face, int channel = 0)
667 //
668 return true;
669}
670
671 template <class MESH>
672 bool
673 TopologyRefinerFactory<MESH>::assignComponentTags(TopologyRefiner& /* refiner */, MESH const& /* mesh */) {
674
675 //
676 // Optional tagging:
677 // This is where any additional feature tags -- sharpness, holes, etc. -- can be
678 // specified using:
679 //
680 // void setBaseEdgeSharpness(TopologyRefiner& newRefiner, Index edge, float sharpness)
681 // void setBaseVertexSharpness(TopologyRefiner& newRefiner, Index vertex, float sharpness)
682 //
683 // void setBaseFaceHole(TopologyRefiner& newRefiner, Index face, bool hole)
684 //
685 return true;
686}
687
688 template <class MESH>
689 void
690 TopologyRefinerFactory<MESH>::reportInvalidTopology(
691 TopologyError /* errCode */, char const * /* msg */, MESH const& /* mesh */) {
692
693 //
694 // Optional topology validation error reporting:
695 // This method is called whenever the factory encounters topology validation
696 // errors. By default, nothing is reported
697 //
698}
699
700} // end namespace Far
701
702} // end namespace OPENSUBDIV_VERSION
703 using namespace OPENSUBDIV_VERSION;
704} // end namespace OpenSubdiv
705
706#endif /* OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H */
topologyRefiner.h
error.h
OpenSubdiv
Definition limits.h:15
OpenSubdiv::OPENSUBDIV_VERSION
Definition limits.h:16
OpenSubdiv::OPENSUBDIV_VERSION::Far
Definition refinerSurfaceFactory.h:19
OpenSubdiv::OPENSUBDIV_VERSION::Far::Error
void Error(ErrorType err, const char *format,...)
Sends an OSD error with a message (internal use only).
OpenSubdiv::OPENSUBDIV_VERSION::Far::LocalIndexArray
Vtr::LocalIndexArray LocalIndexArray
Definition types.h:28
OpenSubdiv::OPENSUBDIV_VERSION::Far::IndexArray
Vtr::IndexArray IndexArray
Definition types.h:27
OpenSubdiv::OPENSUBDIV_VERSION::Far::FAR_RUNTIME_ERROR
@ FAR_RUNTIME_ERROR
Issue a generic runtime error, but continue execution.
Definition error.h:23
OpenSubdiv::OPENSUBDIV_VERSION::Far::Index
Vtr::Index Index
Definition types.h:24
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::SchemeType
SchemeType
Enumerated type for all subdivision schemes supported by OpenSubdiv.
Definition types.h:20
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::SCHEME_CATMARK
@ SCHEME_CATMARK
Definition types.h:22
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory
Factory for constructing TopologyRefiners from specific mesh classes.
Definition topologyRefinerFactory.h:61
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getNumBaseFaces
static int getNumBaseFaces(TopologyRefiner const &newRefiner)
Definition topologyRefinerFactory.h:419
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::assignComponentTopology
static bool assignComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the relationships between vertices, faces, etc. ie the face-vertices, vertex-faces,...
Definition topologyRefinerFactory.h:604
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::reportInvalidTopology
static void reportInvalidTopology(TopologyError errCode, char const *msg, MESH const &mesh)
(Optional) Control run-time topology validation and error reporting
Definition topologyRefinerFactory.h:690
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseVertexFaceLocalIndices
static LocalIndexArray getBaseVertexFaceLocalIndices(TopologyRefiner &newRefiner, Index v)
Assign the local indices of a vertex within each of its incident faces.
Definition topologyRefinerFactory.h:493
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getNumBaseVertices
static int getNumBaseVertices(TopologyRefiner const &newRefiner)
Definition topologyRefinerFactory.h:429
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setNumBaseEdgeFaces
static void setNumBaseEdgeFaces(TopologyRefiner &newRefiner, Index e, int count)
Specify the number of faces incident each edge.
Definition topologyRefinerFactory.h:441
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseFaceVertices
static IndexArray getBaseFaceVertices(TopologyRefiner &newRefiner, Index f)
Assign the vertices incident each face.
Definition topologyRefinerFactory.h:457
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseEdgeFaceLocalIndices
static LocalIndexArray getBaseEdgeFaceLocalIndices(TopologyRefiner &newRefiner, Index e)
Assign the local indices of an edge within each of its incident faces.
Definition topologyRefinerFactory.h:488
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::populateBaseLevel
static bool populateBaseLevel(TopologyRefiner &refiner, MESH const &mesh, Options options)
Definition topologyRefinerFactory.h:354
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::populateBaseLocalIndices
static void populateBaseLocalIndices(TopologyRefiner &newRefiner)
Determine all local indices by inspection (only for pure manifold meshes).
Definition topologyRefinerFactory.h:510
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::assignComponentTags
static bool assignComponentTags(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify edge or vertex sharpness or face holes
Definition topologyRefinerFactory.h:673
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::resizeComponentTopology
static bool resizeComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the number of vertices, faces, face-vertices, etc.
Definition topologyRefinerFactory.h:563
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setNumBaseVertexEdges
static void setNumBaseVertexEdges(TopologyRefiner &newRefiner, Index v, int count)
Specify the number of edges incident each vertex.
Definition topologyRefinerFactory.h:451
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::TopologyError
Vtr::internal::Level::TopologyError TopologyError
Definition topologyRefinerFactory.h:114
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseFaceFVarValues
static IndexArray getBaseFaceFVarValues(TopologyRefiner &newRefiner, Index face, int channel=0)
Assign the face-varying values for the corners of each face.
Definition topologyRefinerFactory.h:556
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseEdgeFaces
static IndexArray getBaseEdgeFaces(TopologyRefiner &newRefiner, Index e)
Assign the faces incident each edge.
Definition topologyRefinerFactory.h:472
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setNumBaseVertexFaces
static void setNumBaseVertexFaces(TopologyRefiner &newRefiner, Index v, int count)
Specify the number of faces incident each vertex.
Definition topologyRefinerFactory.h:446
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::assignFaceVaryingTopology
static bool assignFaceVaryingTopology(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify face-varying data per face
Definition topologyRefinerFactory.h:657
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setBaseVertexSharpness
static void setBaseVertexSharpness(TopologyRefiner &newRefiner, Index v, float sharpness)
Assign a sharpness value to a given vertex.
Definition topologyRefinerFactory.h:532
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseVertexEdgeLocalIndices
static LocalIndexArray getBaseVertexEdgeLocalIndices(TopologyRefiner &newRefiner, Index v)
Assign the local indices of a vertex within each of its incident edges.
Definition topologyRefinerFactory.h:498
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseEdgeVertices
static IndexArray getBaseEdgeVertices(TopologyRefiner &newRefiner, Index e)
Assign the vertices incident each edge.
Definition topologyRefinerFactory.h:467
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseVertexFaces
static IndexArray getBaseVertexFaces(TopologyRefiner &newRefiner, Index v)
Assign the faces incident each vertex.
Definition topologyRefinerFactory.h:477
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setBaseVertexNonManifold
static void setBaseVertexNonManifold(TopologyRefiner &newRefiner, Index v, bool b)
Tag a vertex as non-manifold.
Definition topologyRefinerFactory.h:521
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setNumBaseFaces
static void setNumBaseFaces(TopologyRefiner &newRefiner, int count)
Specify the number of faces to be accommodated.
Definition topologyRefinerFactory.h:403
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseFaceEdges
static IndexArray getBaseFaceEdges(TopologyRefiner &newRefiner, Index f)
Assign the edges incident each face.
Definition topologyRefinerFactory.h:462
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setNumBaseFaceVertices
static void setNumBaseFaceVertices(TopologyRefiner &newRefiner, Index f, int count)
Specify the number of vertices incident each face.
Definition topologyRefinerFactory.h:435
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setBaseEdgeSharpness
static void setBaseEdgeSharpness(TopologyRefiner &newRefiner, Index e, float sharpness)
Assign a sharpness value to a given edge.
Definition topologyRefinerFactory.h:527
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setBaseEdgeNonManifold
static void setBaseEdgeNonManifold(TopologyRefiner &newRefiner, Index e, bool b)
Tag an edge as non-manifold.
Definition topologyRefinerFactory.h:516
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setNumBaseEdges
static void setNumBaseEdges(TopologyRefiner &newRefiner, int count)
Specify the number of edges to be accommodated.
Definition topologyRefinerFactory.h:408
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Create
static TopologyRefiner * Create(MESH const &mesh, Options options=Options())
Instantiates a TopologyRefiner from client-provided topological representation.
Definition topologyRefinerFactory.h:329
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::findBaseEdge
static Index findBaseEdge(TopologyRefiner const &newRefiner, Index v0, Index v1)
Identify an edge to be assigned a sharpness value given a vertex pair.
Definition topologyRefinerFactory.h:504
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getBaseVertexEdges
static IndexArray getBaseVertexEdges(TopologyRefiner &newRefiner, Index v)
Assign the edges incident each vertex.
Definition topologyRefinerFactory.h:482
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::createBaseFVarChannel
static int createBaseFVarChannel(TopologyRefiner &newRefiner, int numValues)
Create a new face-varying channel with the given number of values.
Definition topologyRefinerFactory.h:544
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::getNumBaseEdges
static int getNumBaseEdges(TopologyRefiner const &newRefiner)
Definition topologyRefinerFactory.h:424
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setNumBaseVertices
static void setNumBaseVertices(TopologyRefiner &newRefiner, int count)
Specify the number of vertices to be accommodated.
Definition topologyRefinerFactory.h:413
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::setBaseFaceHole
static void setBaseFaceHole(TopologyRefiner &newRefiner, Index f, bool isHole)
Tag a face as a hole.
Definition topologyRefinerFactory.h:537
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefiner
Stores topology data for a specified set of refinement options.
Definition topologyRefiner.h:34
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase
Private base class of Factories for constructing TopologyRefiners.
Definition topologyRefinerFactory.h:30
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase::prepareComponentTopologyAssignment
static bool prepareComponentTopologyAssignment(TopologyRefiner &refiner, bool fullValidation, TopologyCallback callback, void const *callbackData)
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase::TopologyCallback
Vtr::internal::Level::ValidationCallback TopologyCallback
Definition topologyRefinerFactory.h:37
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase::prepareComponentTagsAndSharpness
static bool prepareComponentTagsAndSharpness(TopologyRefiner &refiner)
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase::prepareComponentTopologySizing
static bool prepareComponentTopologySizing(TopologyRefiner &refiner)
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactoryBase::prepareFaceVaryingChannels
static bool prepareFaceVaryingChannels(TopologyRefiner &refiner)
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options
Options related to the construction of each TopologyRefiner.
Definition topologyRefinerFactory.h:67
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options::Options
Options(Sdc::SchemeType sdcType=Sdc::SCHEME_CATMARK, Sdc::Options sdcOptions=Sdc::Options())
Definition topologyRefinerFactory.h:69
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options::schemeOptions
Sdc::Options schemeOptions
Definition topologyRefinerFactory.h:75
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options::schemeType
Sdc::SchemeType schemeType
The subdivision scheme type identifier.
Definition topologyRefinerFactory.h:74
OpenSubdiv::OPENSUBDIV_VERSION::Far::TopologyRefinerFactory::Options::validateFullTopology
unsigned int validateFullTopology
Definition topologyRefinerFactory.h:77
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options
All supported options applying to subdivision scheme.
Definition options.h:34
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetFVarLinearInterpolation
void SetFVarLinearInterpolation(FVarLinearInterpolation b)
Set face-varying interpolation rule.
Definition options.h:81
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetFVarLinearInterpolation
FVarLinearInterpolation GetFVarLinearInterpolation() const
Get face-varying interpolation rule.
Definition options.h:78