HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 <UT/UT_String.h>
33 #include <UT/UT_StringHolder.h>
34 #include <GA/GA_Types.h>
37 
38 namespace GABC_NAMESPACE
39 {
40 
41 /// This class specifies the options used during Alembic archive export.
42 /// In practice, these options are passed by reference to const, so they are
43 /// set once during setup and never modified during the entrie output process.
45 {
46 public:
48 
49  GABC_OOptions();
50  virtual ~GABC_OOptions() {};
51 
52  /// Method to return the time sampling pointer for output
53  virtual const TimeSamplingPtr &timeSampling() const = 0;
54 
55  /// @{
56  /// Whether to cook full bounding boxes for all nodes
57  bool fullBounds() const { return myFullBounds; }
58  void setFullBounds(bool f) { myFullBounds = f; }
59  /// @}
60 
61  /// @{
62  /// Set path attribute for writing geometry to a specific hierarchy.
63  const char *pathAttribute() const { return myPathAttribute.buffer(); }
64  void setPathAttribute(const char *s) { myPathAttribute.harden(s); }
65  /// @}
66 
67  /// @{
68  /// Group name to identify subdivision surfaces
69  const char *subdGroup() const { return mySubdGroup.buffer(); }
70  void setSubdGroup(const char *g) { mySubdGroup.harden(g); }
71  /// @}
72 
73  /// @{
74  /// Set attribute masks and compare attributes against the masks
75  bool matchAttribute(Alembic::AbcGeom::GeometryScope scope,
76  const char *name) const;
77  bool matchAttribute(GA_AttributeOwner own, const char *name) const;
78  const char *getAttributePattern(GA_AttributeOwner own) const
79  { return myAttributePatterns[own].buffer(); }
81  {
82  myAttributePatterns[own].harden(pattern);
83  }
84  /// @}
85 
86  /// @{
87  /// Pattern of uniform attributes to convert into detail/constant attributes
88  const char *primToDetailPattern() const
89  { return myPrimToDetailPattern; }
90  void setPrimToDetailPattern(const char *s)
91  { myPrimToDetailPattern.harden(s); }
92  /// @}
93 
94  /// @{
95  /// Check whether uniform attributes are constant value before coalescing
96  bool forcePrimToDetail() const
97  { return myForcePrimToDetail; }
99  { myForcePrimToDetail = v; }
100  /// @}
101 
102  /// @{
103  /// Pattern of attributes to save as arrays instead of scalars
104  bool matchArrayAttribPattern(const char *name) const;
105  const char *arrayAttribPattern() const
106  { return myArrayAttribPattern; }
107  void setArrayAttribPattern(const char *s)
108  { myArrayAttribPattern.harden(s); }
109  /// @}
110 
111  /// @{
112  /// Pattern matching for multiple uv sets
113  const char *uvAttribPattern() const { return myUVAttribPattern.buffer(); }
114  void setUVAttribPattern(const char *pattern) { myUVAttribPattern.harden(pattern); }
115  /// @}
116 
117  /// @{
118  /// Output string arrays as a compount property consisting of
119  /// an array of unique strings and an integer arrays with indices into the
120  /// strings.
121  bool outputIndexedArrays() const { return myOutputIndexedArrays; }
122  void setOutputIndexedArrays(bool value) { myOutputIndexedArrays = value; }
123  /// @}
124 
125 private:
126  UT_String mySubdGroup;
127  UT_String myPathAttribute;
128  UT_String myAttributePatterns[GA_ATTRIB_OWNER_N];
129  UT_String myPrimToDetailPattern;
130  UT_String myArrayAttribPattern;
131  UT_String myUVAttribPattern;
132  bool myFullBounds;
133  bool myForcePrimToDetail;
134  bool myOutputIndexedArrays;
135 };
136 
137 } // end GABC_NAMESPACE
138 
139 #endif
void setSubdGroup(const char *g)
Definition: GABC_OOptions.h:70
const char * uvAttribPattern() const
GLboolean GLboolean g
Definition: glcorearb.h:1222
const char * primToDetailPattern() const
Definition: GABC_OOptions.h:88
void setUVAttribPattern(const char *pattern)
Alembic::AbcCoreAbstract::TimeSamplingPtr TimeSamplingPtr
Definition: GABC_OOptions.h:47
GLuint const GLchar * name
Definition: glcorearb.h:786
const char * subdGroup() const
Definition: GABC_OOptions.h:69
#define GABC_NAMESPACE
Definition: GABC_API.h:42
Alembic::Util::shared_ptr< TimeSampling > TimeSamplingPtr
Definition: TimeSampling.h:137
void setAttributePattern(GA_AttributeOwner own, const char *pattern)
Definition: GABC_OOptions.h:80
const char * pathAttribute() const
Definition: GABC_OOptions.h:63
const GLdouble * v
Definition: glcorearb.h:837
const char * getAttributePattern(GA_AttributeOwner own) const
Definition: GABC_OOptions.h:78
GLubyte * pattern
Definition: glew.h:5741
void setArrayAttribPattern(const char *s)
void setPrimToDetailPattern(const char *s)
Definition: GABC_OOptions.h:90
GA_AttributeOwner
Definition: GA_Types.h:33
const char * arrayAttribPattern() const
#define GABC_API
Definition: GABC_API.h:37
GLsizei const GLfloat * value
Definition: glcorearb.h:824
GLfloat f
Definition: glcorearb.h:1926
void setPathAttribute(const char *s)
Definition: GABC_OOptions.h:64
Definition: core.h:1131
GLdouble s
Definition: glew.h:1395
void setOutputIndexedArrays(bool value)