11 #ifndef __GU_Flatten_h__
12 #define __GU_Flatten_h__
24 #define PROJECTED_INITIAL_VALUES 0
35 bool use_input_uv =
false,
36 bool axis_align_islands =
false,
37 bool repack_wasted =
false);
42 {
return myNumIslands; }
48 bool flattenAndPack();
52 int reflattenWithPins();
57 void addDistortionAttribute();
61 void addPointIdAttribute();
64 void addIslandAttribute(
bool add);
76 void addOriginalPinGroup(
const char *
name);
80 void addActivePinGroup(
const char *
name);
82 void addSeamsGroup(
const char *
name);
90 myIslandIndex(-1), myU(0.0), myV(0.0), myToRemove(false) {}
93 myInputVertex(voff), myPoint(ptof), myIslandIndex(is),
94 myU(u), myV(v), myToRemove(false) {}
115 {
return myWarningMessage.str().toStdString(); }
118 void buildIslands(
GU_Detail *gdp,
int num_islands);
123 Island(
GU_Detail *gdp,
int island_id,
bool pos_from_uv =
false);
126 int getIndex()
const {
return myIndex; }
134 GA_OffsetArray &getInputPrimitives() {
return myInputPrimitives; }
139 inline void appendPrimitive(
GA_Offset primoff)
140 { myPrimitives.append(primoff); }
142 { myPoints.append(ptoff); }
143 inline void appendInputPrimitive(
GA_Offset primoff)
144 { myInputPrimitives.append(primoff); }
146 #if PROJECTED_INITIAL_VALUES
147 void setCenter(
UT_Vector3 ctr) { myCenter = ctr; }
148 UT_Vector3 getCenter()
const {
return myCenter; }
150 void setXAxis(
UT_Vector3 ctr) { myXAxis = ctr; }
151 UT_Vector3 getXAxis()
const {
return myXAxis; }
153 void setYAxis(
UT_Vector3 ctr) { myYAxis = ctr; }
154 UT_Vector3 getYAxis()
const {
return myYAxis; }
156 void setWidth(
fpreal w) { myWidth =
w; }
157 fpreal getWidth()
const {
return myWidth; }
165 #if PROJECTED_INITIAL_VALUES
189 void flattenIslandWithInitialPins(Island &island,
194 void flattenLSCM(Island &island,
const PinArray &pins,
195 bool write_to_input_detail,
200 bool write_to_input_detail =
true);
203 void assignIslandInitialPins(Island &island);
206 void recutWithExtraSeams(
bool force_rebuild_islands =
false);
212 {
return myWorkPointToInputVertex(work_pt); }
217 {
return myWorkVertex(vtx); }
220 {
return myInputVertex(vtx); }
222 void getIslandPins(PinMap &pin_map,
int island,
247 return myRGdp->vertexPoint(vtx);
251 bool add_if_missing =
true);
253 bool add_if_missing =
true);
255 void purgeIslands(
int new_num_islands = 0);
256 Island *getIsland(
int i,
GU_Detail *gdp);
257 void buildInputVertexClasses();
260 *getInputHedgeInterface();
271 PinMap myInitialPins;
272 PinMap myCurrentPins;
294 int myInitialNumIslands;
296 IslandArray myIslands;
301 bool myAxisAlignIslands;
312 GU_Flatten::Island::getPos3(
GA_Offset pt)
const
315 return myOrigUV.get(myGdp->pointVertex(pt));
317 return myGdp->getPos3(pt);
Definition of a geometry attribute.
GA_Offset getPoint() const
GLsizei const GLchar *const * string
SYS_FORCE_INLINE bool GAisValid(GA_Size v)
#define GA_INVALID_OFFSET
An bi-directional stream object that owns its own string buffer storage.
const std::string getWarningMessage()
UT_UniquePtr< GA_PrimitiveGroup > GA_PrimitiveGroupUPtr
GA_Offset getInputVertex() const
GLuint const GLchar * name
GLboolean GLboolean GLboolean b
GU_API Status flattenIsland(Method method, const Island &island, const ConstraintSet &constraints, RWHandleV3R uvh)
GLubyte GLubyte GLubyte GLubyte w
ImageBuf OIIO_API add(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
Pin(GA_Offset voff, GA_Offset ptof, int is, fpreal u, fpreal v)
int getIslandIndex() const
UT_StringArray JOINTS hip
UT_UniquePtr< GA_EdgeGroup > GA_EdgeGroupUPtr