HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GABC_OOptions.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) COPYRIGHTYEAR
3  * Side Effects Software Inc. All rights reserved.
4  *
5  * Redistribution and use of Houdini Development Kit samples in source and
6  * binary forms, with or without modification, are permitted provided that the
7  * following conditions are met:
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * 2. The name of Side Effects Software may not be used to endorse or
11  * promote products derived from this software without specific prior
12  * written permission.
13  *
14  * THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE `AS IS' AND ANY EXPRESS
15  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17  * NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
18  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
20  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  *----------------------------------------------------------------------------
26  */
27 
28 #ifndef __GABC_OOptions__
29 #define __GABC_OOptions__
30 
31 #include "GABC_API.h"
32 #include "GABC_Include.h"
33 #include <UT/UT_String.h>
34 #include <UT/UT_StringHolder.h>
35 #include <GA/GA_Types.h>
38 
39 namespace GABC_NAMESPACE
40 {
41 
42 /// This class specifies the options used during Alembic archive export.
43 /// In practice, these options are passed by reference to const, so they are
44 /// set once during setup and never modified during the entrie output process.
46 {
47 public:
49 
50  GABC_OOptions();
51  virtual ~GABC_OOptions() {};
52 
53  /// Method to return the time sampling pointer for output
54  virtual const TimeSamplingPtr &timeSampling() const = 0;
55 
56  /// @{
57  /// The first frame of output
58  exint firstFrame() const { return myFirstFrame; }
59  void setFirstFrame(exint f) { myFirstFrame = f; }
60  /// @}
61  /// @{
62  /// Whether to cook full bounding boxes for all nodes
63  bool fullBounds() const { return myFullBounds; }
64  void setFullBounds(bool f) { myFullBounds = f; }
65  /// @}
66 
67  /// @{
68  /// Set path attribute for writing geometry to a specific hierarchy.
69  const char *pathAttribute() const { return myPathAttribute.buffer(); }
70  void setPathAttribute(const char *s) { myPathAttribute.harden(s); }
71  /// @}
72 
73  /// @{
74  /// Group name to identify subdivision surfaces
75  const char *subdGroup() const { return mySubdGroup.buffer(); }
76  void setSubdGroup(const char *g) { mySubdGroup.harden(g); }
77  /// @}
78 
79  /// @{
80  /// Set attribute masks and compare attributes against the masks
81  bool matchAttribute(Alembic::AbcGeom::GeometryScope scope,
82  const char *name) const;
83  bool matchAttribute(GA_AttributeOwner own, const char *name) const;
84  const char *getAttributePattern(GA_AttributeOwner own) const
85  { return myAttributePatterns[own].buffer(); }
86  void setAttributePattern(GA_AttributeOwner own, const char *pattern)
87  {
88  myAttributePatterns[own].harden(pattern);
89  }
90  /// @}
91 
92  /// @{
93  /// Pattern matching for multiple uv sets
94  const char *uvAttribPattern() const { return myUVAttribPattern.buffer(); }
95  void setUVAttribPattern(const char *pattern) { myUVAttribPattern.harden(pattern); }
96  /// @}
97 
98  /// @{
99  /// Pattern of uniform attributes to convert into detail/constant attributes
101  { return myPrimToDetailPattern; }
103  { myPrimToDetailPattern = p; }
104  /// @}
105 
106  /// @{
107  /// Check whether uniform attributes are constant value before coalescing
108  bool forcePrimToDetail() const
109  { return myForcePrimToDetail; }
111  { myForcePrimToDetail = v; }
112  /// @}
113 
114 private:
115  UT_String mySubdGroup;
116  UT_String myPathAttribute;
117  UT_String myAttributePatterns[GA_ATTRIB_OWNER_N];
118  UT_String myUVAttribPattern;
119  UT_StringHolder myPrimToDetailPattern;
120  exint myFirstFrame;
121  bool myFullBounds;
122  bool myForcePrimToDetail;
123 };
124 
125 } // end GABC_NAMESPACE
126 
127 #endif
const UT_StringHolder & uniformToDetailPattern() const
void setSubdGroup(const char *g)
Definition: GABC_OOptions.h:76
const GLdouble * v
Definition: glcorearb.h:836
const char * uvAttribPattern() const
Definition: GABC_OOptions.h:94
GLboolean GLboolean g
Definition: glcorearb.h:1221
void setPrimToDetailPattern(const UT_StringHolder &p)
void setUVAttribPattern(const char *pattern)
Definition: GABC_OOptions.h:95
Alembic::AbcCoreAbstract::TimeSamplingPtr TimeSamplingPtr
Definition: GABC_OOptions.h:48
const char * subdGroup() const
Definition: GABC_OOptions.h:75
#define GABC_NAMESPACE
Definition: GABC_API.h:42
Alembic::Util::shared_ptr< TimeSampling > TimeSamplingPtr
Definition: TimeSampling.h:137
GLfloat f
Definition: glcorearb.h:1925
void setAttributePattern(GA_AttributeOwner own, const char *pattern)
Definition: GABC_OOptions.h:86
int64 exint
Definition: SYS_Types.h:109
const char * pathAttribute() const
Definition: GABC_OOptions.h:69
GLuint const GLchar * name
Definition: glcorearb.h:785
const char * getAttributePattern(GA_AttributeOwner own) const
Definition: GABC_OOptions.h:84
GA_AttributeOwner
Definition: GA_Types.h:33
#define GABC_API
Definition: GABC_API.h:37
void setPathAttribute(const char *s)
Definition: GABC_OOptions.h:70