17 #ifndef _GT_AgentSupport_h_
18 #define _GT_AgentSupport_h_
63 : myLayerIdx(layer_idx), myBindingIdx(shape_idx)
77 void clear() { myIndexMap.entries(0); }
82 {
return myIndexMap(ga_index); }
84 void setAgentIndex(
int ga_index,
int agent_index);
100 { myVisibility(idx) = visible ?
lod : 0.0; }
103 {
return myVisibility(idx) != 0.0f; }
107 lod = myVisibility(idx);
126 myTransforms.entries(entries);
127 myChannelValues.entries(entries);
128 mySerial.entries(entries);
132 {
return myTransforms(agent_idx); }
135 {
return *myTransforms(agent_idx); }
138 {
return myChannelValues[agent_idx]; }
141 {
return *myChannelValues(agent_idx); }
145 { mySerial(agent_idx) = serial; }
161 {
return myTransforms(agent_idx); }
164 {
return myTransforms(agent_idx); }
178 void clear() { mySelection.zero(); mySelectState = 0; }
179 void allSelected() { mySelection.constant(1); mySelectState = 1; }
183 { mySelection(idx) = selected?1:0; }
186 {
return mySelection(idx)==1; }
210 { memcpy(id_array, myIDs.array(), myIDs.entries()*
sizeof(
int));}
243 myColors.setSizeNoInit(num_agents * 4);
249 colors->extendedFillArray(myColors.data(), 0, 1, 3, num_agents,
253 colors->fillArray(myColors.data(), 0, num_agents, 3, 4);
259 bool hasColor()
const {
return !myColors.isEmpty(); }
264 memcpy(data, myColors.data() + 4 * agent_idx, 4 *
sizeof(
uint8));
273 namespace GT_AgentDeformFlags
275 static constexpr
uint None = 0;
276 static constexpr
uint BlendShapes = 1;
277 static constexpr
uint Skinning = 2;
301 return myDeformFlags != GT_AgentDeformFlags::None;
305 return myDeformFlags & GT_AgentDeformFlags::Skinning;
309 return myDeformFlags & GT_AgentDeformFlags::BlendShapes;
Mapping from GA_Index to per-rig agent index.
Visibility and LOD class for agents.
void setEntries(exint entries)
Contains IDs for each agent.
bool isFullySelected() const
void setEntries(exint entries)
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
bool isSelected(exint idx) const
GT_AgentIDHandle myAgentPrimID
GT_AgentShapeBindingID(int layer_idx, int shape_idx)
Contains colors for each agent.
UT_Array< const GU_PrimPacked * > myAgents
UT_Array< RE_VertexArray * > * myRigTransformVA
UT_Matrix4FArray myInvRestTransforms
Inverse rest transform for each region.
bool getLOD(exint idx, fpreal32 &lod) const
void setEntries(exint entries)
Data common to all levels-of-detail for a series of GT_PrimAgentShapes.
A reference counter base class for use with UT_IntrusivePtr.
UT_IntrusivePtr< GT_ShapeLODGroup > GT_ShapeLODGroupHandle
void setSelected(exint idx, bool selected)
UT_Array< RE_VertexArray * > * myPrimIDVA
UT_IntrusivePtr< GT_AgentColors > GT_AgentColorsHandle
GU_AgentBlendShapeUtils::InputCache myBlendShapeInputs
void fetchColor(exint agent_idx, uint8 *data) const
Fetch the (4 uint8) color for an agent.
int getID(exint idx) const
GT_AgentColorsHandle myAgentColors
UT_Array< GT_AgentShapeBindingID > myBindings
void fetchIDs(int *id_array) const
vint4 select(const vbool4 &mask, const vint4 &a, const vint4 &b)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
GT_AgentSelectionHandle myAgentSelection
bool hasBlendShapes() const
#define SYS_DECLARE_IS_POD(T)
Declare a type as POD.
void setColors(const GT_DataArrayHandle &colors, GT_Owner owner, exint num_agents)
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
GT_AgentShapeRigInfoHandle myRigInfo
GT_AgentRigTransformsHandle myAgentRigTransforms
bool isNothingSelected() const
UT_IntrusivePtr< GT_AgentVisibility > GT_AgentVisibilityHandle
UT_IntArray myDeformMap
Map from region index to agent rig index.
GT_AgentTransformsHandle myAgentTransforms
GT_AgentVisibilityHandle myVisibility
GT_AgentIndexMapHandle myAgentIndexMap
UT_IntrusivePtr< GT_AgentID > GT_AgentIDHandle
UT_Array< RE_VertexArray * > * myTransformVA
int getAgentIndex(exint ga_index) const
const UT_IntArray & getIDs() const
UT_Array< RE_VertexArray * > * mySelectionVA
UT_IntrusivePtr< GT_AgentIndexMap > GT_AgentIndexMapHandle
UT_IntrusivePtr< GT_AgentSelection > GT_AgentSelectionHandle
UT_Array< RE_VertexArray * > * myColorVA
bool isPartiallySelected() const
void setID(exint idx, int id)
Contains a bool array of selected agents.
void setVisibility(exint idx, bool visible, fpreal lod=1.0)
UT_IntrusivePtr< GT_AgentRigTransforms > GT_AgentRigTransformsHandle
bool getVisibility(exint idx) const
Index of a shape binding in one of the agent's current layers.
UT_IntrusivePtr< GT_AgentShapeRigInfo > GT_AgentShapeRigInfoHandle
UT_IntrusivePtr< GT_AgentTransforms > GT_AgentTransformsHandle