本文整理汇总了C++中Tab::SetCount方法的典型用法代码示例。如果您正苦于以下问题:C++ Tab::SetCount方法的具体用法?C++ Tab::SetCount怎么用?C++ Tab::SetCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tab
的用法示例。
在下文中一共展示了Tab::SetCount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HitTestCrossSection
BOOL SplineData::HitTestCrossSection(GraphicsWindow *gw, HitRegion hr, SplineMapProjectionTypes projType, Tab<int> &hitSplines, Tab<int> &hitCrossSections)
{
hitSplines.SetCount(0);
hitCrossSections.SetCount(0);
DWORD limit = gw->getRndLimits();
gw->setRndLimits(( limit | GW_PICK) & ~GW_ILLUM);
gw->setHitRegion(&hr);
//loop through splines
for (int splineIndex = 0; splineIndex < mSplineElementData.Count();splineIndex++)
{
if (mSplineElementData[splineIndex]->IsSelected())
{
for (int crossSectionIndex = 0; crossSectionIndex < NumberOfCrossSections(splineIndex); crossSectionIndex++)
{
SplineCrossSection section = mSplineElementData[splineIndex]->GetCrossSection(crossSectionIndex);
Matrix3 crossSectionTM = section.mTM;
gw->setTransform(crossSectionTM);
gw->clearHitCode();
mSplineElementData[splineIndex]->DisplayCrossSections(gw, crossSectionIndex,projType );
if (gw->checkHitCode())
{
hitSplines.Append(1,&splineIndex,10);
hitCrossSections.Append(1,&crossSectionIndex,10);
}
}
}
}
return hitSplines.Count();
}
示例2: CheckCancel
void Unreal3DExport::WriteTracking()
{
Tab<Point3> Loc;
Tab<Quat> Quat;
Tab<Point3> Euler;
Loc.SetCount(FrameCount);
Quat.SetCount(FrameCount);
Euler.SetCount(FrameCount);
for( int n=0; n<TrackedNodes.Count(); ++n )
{
IGameNode* node = TrackedNodes[n];
for( int t=0; t<FrameCount; ++t )
{
// Progress
CheckCancel();
// Set frame
int curframe = FrameStart + t;
pScene->SetStaticFrame(curframe);
// Write tracking
GMatrix objTM = node->GetWorldTM();
Loc[t] = objTM.Translation();
Quat[t] = objTM.Rotation();
float eu[3];
QuatToEuler(Quat[t],eu);
Euler[t]=Point3(eu[0],eu[1],eu[2]);
Euler[t] *= 180.0f/pi;
eu[1] *= -1;
EulerToQuat(eu,Quat[t],EULERTYPE_YXZ);
}
for( int t=0; t<FrameCount; ++t )
{
_ftprintf( fLog, _T("%sLoc[%d]=(X=%f,Y=%f,Z=%f)\n"), node->GetName(), t, Loc[t].x, Loc[t].y, Loc[t].z );
}
for( int t=0; t<FrameCount; ++t )
{
_ftprintf( fLog, _T("%sQuat[%d]=(W=%f,X=%f,Y=%f,Z=%f)\n"), node->GetName(), t, Quat[t].w, Quat[t].x, Quat[t].y, Quat[t].z );
}
for( int t=0; t<FrameCount; ++t )
{
_ftprintf( fLog, _T("%sEuler[%d]=(X=%f,Y=%f,Z=%f)\n"), node->GetName(), t, Euler[t].x, Euler[t].y, Euler[t].z );
}
}
}
示例3: ModifyObject
void AFRMod::ModifyObject (TimeValue t, ModContext &mc, ObjectState *os, INode *node) {
Interval iv = FOREVER;
float f, p, b;
int backface;
Point3 pt1, pt2;
pblock->GetValue(PB_FALLOFF,t,f,iv);
pblock->GetValue(PB_PINCH,t,p,iv);
pblock->GetValue(PB_BUBBLE,t,b,iv);
pblock->GetValue(PB_BACKFACE,t,backface,iv);
p1->GetValue(t,&pt1,iv,CTRL_ABSOLUTE);
p2->GetValue(t,&pt2,iv,CTRL_ABSOLUTE);
if (f==0.0) {
os->obj->UpdateValidity(GEOM_CHAN_NUM,iv);
return;
}
Tab<Point3> normals;
if (backface) {
// Need to get vertex normals.
if (os->obj->IsSubClassOf(triObjectClassID)) {
TriObject *tobj = (TriObject*)os->obj;
AverageVertexNormals (tobj->GetMesh(), normals);
} else if (os->obj->IsSubClassOf (polyObjectClassID)) {
PolyObject *pobj = (PolyObject *) os->obj;
MNMesh &mesh = pobj->GetMesh();
normals.SetCount (mesh.numv);
Point3 *vn = normals.Addr(0);
for (int i=0; i<mesh.numv; i++) {
if (mesh.v[i].GetFlag (MN_DEAD)) vn[i]=Point3(0,0,0);
else vn[i] = mesh.GetVertexNormal (i);
}
#ifndef NO_PATCHES
} else if (os->obj->IsSubClassOf (patchObjectClassID)) {
PatchObject *pobj = (PatchObject *) os->obj;
normals.SetCount (pobj->NumPoints ());
Point3 *vn = normals.Addr(0);
for (int i=0; i<pobj->NumPoints(); i++) vn[i] = pobj->VertexNormal (i);
#endif
}
}
if (normals.Count()) {
AFRDeformer deformer(mc,f,p,b,pt1,pt2,&normals);
os->obj->Deform(&deformer, TRUE);
} else {
AFRDeformer deformer(mc,f,p,b,pt1,pt2);
os->obj->Deform(&deformer, TRUE);
}
os->obj->UpdateValidity(GEOM_CHAN_NUM,iv);
}
示例4: ReInit
void Water::ReInit() {
float c[3], d;
if (count!=waves.Count()) {
waves.SetCount(count);
waves.Resize(count);
}
// Reseed random number generator
srand(randSeed);
// Compute wave centers on sphere with radius size
for (int i = 0; i < count; i++) {
WaveDesc &wv = waves[i];
c[0] = frand();
c[1] = (type == 0) ? frand() : 0.0f;
c[2] = frand();
d = size/(float)sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);
wv.cent[0] = c[0]*d;
wv.cent[1] = c[1]*d;
wv.cent[2] = c[2]*d;
wv.period = (((float)(rand()&0x7FFF))/32768.0f)*
(maxperiod-minperiod)+minperiod;
wv.rate = (float)sqrt(maxperiod/wv.period);
}
}
示例5: RebuildPaintNodes
void BonesDefMod::RebuildPaintNodes()
{
//this sends all our dependant nodes to the painter
MyEnumProc dep;
EnumDependents(&dep);
Tab<INode *> nodes;
for (int i = 0; i < nodes.Count(); i++)
{
ObjectState os = nodes[i]->EvalWorldState(GetCOREInterface()->GetTime());
if ( (os.obj->NumPoints() != painterData[i].bmd->VertexData.Count()) ||
(painterData[i].bmd->isPatch) || (painterData[i].bmd->inputObjectIsNURBS) )
{
int ct = painterData[i].bmd->VertexData.Count();
Tab<Point3> pointList;
pointList.SetCount(ct);
Matrix3 tm = nodes[i]->GetObjectTM(GetCOREInterface()->GetTime());
for (int j =0; j < ct; j++)
{
pointList[j] = painterData[i].bmd->VertexData[j]->LocalPosPostDeform*tm;
}
pPainterInterface->LoadCustomPointGather(ct, pointList.Addr(0), nodes[i]);
}
}
pPainterInterface->UpdateMeshes(TRUE);
}
示例6: CloneFaces
void UVW_ChannelClass::CloneFaces(Tab<UVW_TVFaceClass*> &t)
{
int ct = f.Count();
t.SetCount(ct);
for (int i =0; i < ct; i++)
t[i] = f[i]->Clone();
}
示例7: Do
void PolyOpExtrudeEdge::Do (MNMesh & mesh) {
MNChamferData chamData;
chamData.InitToMesh(mesh);
Tab<Point3> tUpDir;
tUpDir.SetCount (mesh.numv);
// Topology change:
if (!mesh.ExtrudeEdges (MN_USER, &chamData, tUpDir)) return;
// Apply map changes based on base width:
int i;
Tab<UVVert> tMapDelta;
for (int mapChannel=-NUM_HIDDENMAPS; mapChannel<mesh.numm; mapChannel++) {
if (mesh.M(mapChannel)->GetFlag (MN_DEAD)) continue;
chamData.GetMapDelta (mesh, mapChannel, mWidth, tMapDelta);
UVVert *pMapVerts = mesh.M(mapChannel)->v;
if (!pMapVerts) continue;
for (i=0; i<mesh.M(mapChannel)->numv; i++) pMapVerts[i] += tMapDelta[i];
}
// Apply geom changes based on base width:
Tab<Point3> tDelta;
chamData.GetDelta (mWidth, tDelta);
for (i=0; i<mesh.numv; i++) mesh.v[i].p += tDelta[i];
// Move the points up:
for (i=0; i<tUpDir.Count(); i++) mesh.v[i].p += tUpDir[i]*mHeight;
}
示例8: GetComponents
bool GetComponents()
{
fSelectedNodes.ZeroCount();
fSharedComps.ZeroCount();
Interface *ip = GetCOREInterface();
int nodeCount = ip->GetSelNodeCount();
if (nodeCount == 0)
return false;
// Get the components shared among the selected nodes
int i;
fSelectedNodes.SetCount(nodeCount);
for (i = 0; i < nodeCount; i++)
fSelectedNodes[i] = ip->GetSelNode(i);
INodeTab sharedComps;
if (plSharedComponents(fSelectedNodes, sharedComps) == 0)
return false;
// Put the shared components in a list
fSharedComps.SetCount(sharedComps.Count());
for (i = 0; i < sharedComps.Count(); i++)
fSharedComps[i] = ((plMaxNode*)sharedComps[i])->ConvertToComponent();
return true;
}
示例9: Load
IOResult ParticleMesherObject::Load(ILoad *iload)
{
IOResult res = IO_OK;
ULONG nb;
SimpleObject2::Load(iload);
// Default names
int ct = 0;
while (IO_OK==(res=iload->OpenChunk())) {
switch (iload->CurChunkID()) {
case TMCOUNT_CHUNK:
{
int ct;
iload->Read(&ct,sizeof(ct),&nb);
tmList.SetCount(ct);
break;
}
case TMDATA_CHUNK:
{
Matrix3 tm;
tm.Load(iload);
tmList[ct++] = tm;
break;
}
}
iload->CloseChunk();
if (res!=IO_OK) return res;
}
return IO_OK;
}
示例10: SetNum
void Water::SetNum(int i, TimeValue t, BOOL init) {
count = i;
waves.SetCount(count);
waves.Resize(count);
// pblock->SetValue(PB_NUM, t, i);
pblock->SetValue(water_num, t, i);
if (init) ReInit();
}
示例11: SynchSize
void EditFaceDataModData::SynchSize (int numFaces) {
if (numFaces<0) {
// We're supposed to get the right size from the cache.
if (mpCacheMesh) numFaces = mpCacheMesh->numFaces;
if (mpCacheMNMesh) numFaces = mpCacheMNMesh->numf;
if (numFaces<0) return; // do nothing if cache missing.
}
mFaceSel.SetSize (numFaces, true);
mFacesAffected.SetSize (numFaces, true);
mtNewFaceValues.SetCount (numFaces);
}
示例12: SplineElementData
void SplineData::CopyCrossSectionData(Tab<SplineElementData*> &data)
{
data.SetCount(mSplineElementData.Count());
for (int i = 0; i < mSplineElementData.Count(); i++)
{
if (mSplineElementData[i])
{
data[i] = new SplineElementData(mSplineElementData[i]);
}
}
}
示例13: if
void Unreal3DExport::Prepare()
{
// Optimize
if( bMaxResolution && Points.Count() > 1 )
{
pInt->ProgressUpdate(Progress, FALSE, GetString(IDS_INFO_OPT_SCAN));
Point3 MaxPoint = Points[0];
Point3 MinPoint = MaxPoint;
// get scene bounding box
for( int i=1; i<Points.Count(); ++i )
{
if ( Points[i].x > MaxPoint.x ) MaxPoint.x = Points[i].x;
else if ( Points[i].x < MinPoint.x ) MinPoint.x = Points[i].x;
if ( Points[i].y > MaxPoint.y ) MaxPoint.y = Points[i].y;
else if ( Points[i].y < MinPoint.y ) MinPoint.y = Points[i].y;
if ( Points[i].z > MaxPoint.z ) MaxPoint.z = Points[i].z;
else if ( Points[i].z < MinPoint.z ) MinPoint.z = Points[i].z;
}
// get center point
OptOffset = MaxPoint+MinPoint;
OptOffset *= 0.5;
// center bounding box
MaxPoint -= OptOffset;
MinPoint -= OptOffset;
// See FMeshVert
OptScale.x = 1023.0f / max(fabs(MaxPoint.x),fabs(MinPoint.x));
OptScale.y = 1023.0f / max(fabs(MaxPoint.y),fabs(MinPoint.y));
OptScale.z = 511.0f / max(fabs(MaxPoint.z),fabs(MinPoint.z));
// apply adjustments
pInt->ProgressUpdate(Progress, FALSE, GetString(IDS_INFO_OPT_APPLY));
for( int i=0; i<Points.Count(); ++i )
{
Point3& p = Points[i];
p -= OptOffset;
p *= OptScale;
}
}
// Convert verts
Verts.SetCount(Points.Count(),TRUE);
for( int i=0; i<Points.Count(); ++i )
{
Verts[i] = FMeshVert(Points[i]);
}
}
示例14:
void SplineData::GetSelectedSplines(Tab<int> &selSplines)
{
selSplines.SetCount(0);
for (int i = 0; i < mSplineElementData.Count(); i++)
{
if (mSplineElementData[i]->IsSelected())
{
selSplines.Append(1,&i,10);
}
}
}
示例15: Load
IOResult Composite::Load(ILoad *iload) {
IOResult res;
ULONG nb;
Param1 = TRUE;
while (IO_OK==(res=iload->OpenChunk())) {
int id = iload->CurChunkID();
if (id>=MAPOFF_CHUNK&&id<=MAPOFF_CHUNK+0x1000) {
mapOn[id-MAPOFF_CHUNK] = FALSE;
}
else
switch(id) {
case SUBTEX_COUNT_CHUNK: {
int c;
iload->Read(&c,sizeof(c),&nb);
subTex.SetCount(c);
mapOn.SetCount(c);
for (int i=0; i<c; i++) {
subTex[i] = NULL;
mapOn[i] = TRUE;
}
break;
}
case MTL_HDR_CHUNK:
res = MtlBase::Load(iload);
break;
case PARAM2_CHUNK:
Param1 = FALSE;
break;
}
iload->CloseChunk();
if (res!=IO_OK)
return res;
}
CompTexPostLoadCallback* comptexplcb = new CompTexPostLoadCallback(this,Param1,mapOn);
iload->RegisterPostLoadCallback(comptexplcb);
return IO_OK;
}