本文整理汇总了C++中Test_Flag函数的典型用法代码示例。如果您正苦于以下问题:C++ Test_Flag函数的具体用法?C++ Test_Flag怎么用?C++ Test_Flag使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Test_Flag函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetViewDataPtr
void PhotonEstimationTask::SearchThroughObjectsEstimatePhotons(vector<ObjectPtr>& Objects, LightSource *Light)
{
ViewThreadData *renderDataPtr = GetViewDataPtr();
shared_ptr<SceneData> sceneData = GetSceneData();
/* check this object and all siblings */
for(vector<ObjectPtr>::iterator Sib = Objects.begin(); Sib != Objects.end(); Sib++)
{
if(Test_Flag((*Sib), PH_TARGET_FLAG) &&
!((*Sib)->Type & LIGHT_SOURCE_OBJECT))
{
/* do not shoot photons if global lights are turned off for ObjectPtr */
if(!Test_Flag((*Sib), NO_GLOBAL_LIGHTS_FLAG))
{
EstimatePhotonsForObjectAndLight((*Sib), Light);
}
Cooperate();
}
/* if it has children, check them too */
else if(((*Sib)->Type & IS_COMPOUND_OBJECT))
{
SearchThroughObjectsEstimatePhotons(((CSG *)(*Sib))->children, Light);
}
}
}
示例2: MInvTransPoint
bool Sphere::Inside(const Vector3d& IPoint, TraceThreadData *Thread) const
{
DBL OCSquared;
Vector3d Origin_To_Center;
if(Do_Ellipsoid)
{
DBL OCSquared;
Vector3d New_Point;
/* Transform the point into the sphere's space */
MInvTransPoint(New_Point, IPoint, Trans);
Origin_To_Center = Center - New_Point;
OCSquared = Origin_To_Center.lengthSqr();
if (Test_Flag(this, INVERTED_FLAG))
return(OCSquared > Sqr(Radius));
else
return(OCSquared < Sqr(Radius));
}
else
{
Origin_To_Center = Center - IPoint;
OCSquared = Origin_To_Center.lengthSqr();
if(Test_Flag(this, INVERTED_FLAG))
return(OCSquared > Sqr(Radius));
else
return(OCSquared < Sqr(Radius));
}
}
示例3: MInvTransPoint
bool Sor::Inside(const Vector3d& IPoint, TraceThreadData *Thread) const
{
int i;
DBL r0, r;
Vector3d P;
SOR_SPLINE_ENTRY *Entry=NULL;
/* Transform the point into the surface of revolution space. */
MInvTransPoint(P, IPoint, Trans);
/* Test if we are inside the cylindrical bound. */
if ((P[Y] >= Height1) && (P[Y] <= Height2))
{
r0 = P[X] * P[X] + P[Z] * P[Z];
/* Test if we are inside the cylindrical bound. */
if (r0 <= Sqr(Radius2))
{
/* Now find the segment the point is in. */
for (i = 0; i < Number; i++)
{
Entry = &Spline->Entry[i];
if ((P[Y] >= Spline->BCyl->height[Spline->BCyl->entry[i].h1]) &&
(P[Y] <= Spline->BCyl->height[Spline->BCyl->entry[i].h2]))
{
break;
}
}
/* Have we found any segment? */
if (i < Number)
{
r = P[Y] * (P[Y] * (P[Y] * Entry->A + Entry->B) + Entry->C) + Entry->D;
if (r0 <= r)
{
/* We're inside. */
return(!Test_Flag(this, INVERTED_FLAG));
}
}
}
}
/* We're outside. */
return(Test_Flag(this, INVERTED_FLAG));
}
示例4: MInvTransPoint
bool Lemon::Inside(const Vector3d& IPoint, TraceThreadData *Thread) const
{
DBL OCSquared;
DBL horizontal, vertical;
bool INSide = false;
Vector3d New_Point;
MInvTransPoint(New_Point, IPoint, Trans);
vertical = New_Point[Z];
if ((vertical >= 0.0) && (vertical <= 1.0))
{
horizontal = sqrt(Sqr(New_Point[X]) + Sqr(New_Point[Y]));
OCSquared = Sqr(horizontal - HorizontalPosition) + Sqr((vertical - VerticalPosition));
if (OCSquared < Sqr(inner_radius))
{
INSide = true;
}
}
if (Test_Flag(this, INVERTED_FLAG))
{
return !INSide;
}
else
{
return INSide;
}
}
示例5: Transform_Smooth_Triangle
static void Transform_Smooth_Triangle(OBJECT *Object, TRANSFORM *Trans)
{
SMOOTH_TRIANGLE *Triangle = (SMOOTH_TRIANGLE *)Object;
if (!Test_Flag(Object, DEGENERATE_FLAG))
{
/* BEG ROSE
This is useless, because Compute_Triange recalculates this anyway:
MTransPoint(Triangle->Normal_Vector,Triangle->Normal_Vector, Trans);
END ROSE */
MTransPoint(Triangle->P1, Triangle->P1, Trans);
MTransPoint(Triangle->P2, Triangle->P2, Trans);
MTransPoint(Triangle->P3, Triangle->P3, Trans);
/* BEG ROSE
This code is definitely wrong:
MTransPoint(Triangle->N1, Triangle->N1, Trans);
MTransPoint(Triangle->N2, Triangle->N2, Trans);
MTransPoint(Triangle->N3, Triangle->N3, Trans);
Bug fix for this: */
MTransNormal(Triangle->N1,Triangle->N1,Trans);
MTransNormal(Triangle->N2,Triangle->N2,Trans);
MTransNormal(Triangle->N3,Triangle->N3,Trans);
/* END ROSE */
Compute_Triangle((TRIANGLE *)Triangle, true);
}
}
示例6: MInvTransPoint
bool Fractal::Inside(const Vector3d& IPoint, TraceThreadData *Thread) const
{
bool Result;
Vector3d New_Point;
if (Trans != NULL)
{
MInvTransPoint(New_Point, IPoint, Trans);
Result = Iteration(New_Point, this, Thread->Fractal_IStack);
}
else
{
Result = Iteration(IPoint, this, Thread->Fractal_IStack);
}
if (Test_Flag(this, INVERTED_FLAG))
{
return (!Result);
}
else
{
return (Result);
}
}
示例7: Rotate_Triangle
static void Rotate_Triangle(OBJECT *Object, VECTOR, TRANSFORM *Trans)
{
if (!Test_Flag(Object, DEGENERATE_FLAG))
{
Transform_Triangle(Object, Trans);
}
}
示例8: Scale_Triangle
static void Scale_Triangle(OBJECT *Object, VECTOR Vector, TRANSFORM * /*Trans*/)
{
/*DBL Length;*/
TRIANGLE *Triangle = (TRIANGLE *)Object;
if (!Test_Flag(Object, DEGENERATE_FLAG))
{
/* BEG ROSE
this is useless, because Compute_Triangle recalculates this anyway:
Triangle->Normal_Vector[X] = Triangle->Normal_Vector[X] / Vector[X];
Triangle->Normal_Vector[Y] = Triangle->Normal_Vector[Y] / Vector[Y];
Triangle->Normal_Vector[Z] = Triangle->Normal_Vector[Z] / Vector[Z];
VLength(Length, Triangle->Normal_Vector);
VInverseScaleEq(Triangle->Normal_Vector, Length);
Triangle->Distance /= Length;
END ROSE */
VEvaluateEq(Triangle->P1, Vector);
VEvaluateEq(Triangle->P2, Vector);
VEvaluateEq(Triangle->P3, Vector);
Compute_Triangle(Triangle, false);
}
}
示例9: Transform_Object
void Transform_Object (ObjectPtr Object, const TRANSFORM *Trans)
{
if (Object == NULL)
return;
for(vector<ObjectPtr>::iterator Sib = Object->Bound.begin(); Sib != Object->Bound.end(); Sib++)
{
Transform_Object(*Sib, Trans);
}
if (Object->Clip != Object->Bound)
{
for(vector<ObjectPtr>::iterator Sib = Object->Clip.begin(); Sib != Object->Clip.end(); Sib++)
{
Transform_Object(*Sib, Trans);
}
}
/* NK 1998 added if */
if (!Test_Flag(Object, UV_FLAG))
{
Transform_Textures(Object->Texture, Trans);
Transform_Textures(Object->Interior_Texture, Trans);
}
if(Object->interior != NULL)
Object->interior->Transform(Trans);
Object->Transform(Trans);
}
示例10: Scale_Object
void Scale_Object (ObjectPtr Object, const VECTOR Vector, const TRANSFORM *Trans)
{
if (Object == NULL)
return;
for(vector<ObjectPtr>::iterator Sib = Object->Bound.begin(); Sib != Object->Bound.end(); Sib++)
{
Scale_Object(*Sib, Vector, Trans);
}
if (Object->Clip != Object->Bound)
{
for(vector<ObjectPtr>::iterator Sib = Object->Clip.begin(); Sib != Object->Clip.end(); Sib++)
Scale_Object(*Sib, Vector, Trans);
}
/* NK 1998 added if */
if (!Test_Flag(Object, UV_FLAG))
{
Transform_Textures(Object->Texture, Trans);
Transform_Textures(Object->Interior_Texture, Trans);
}
if (Object->UV_Trans == NULL)
Object->UV_Trans = Create_Transform();
Compose_Transforms(Object->UV_Trans, Trans);
if(Object->interior != NULL)
Object->interior->Transform(Trans);
Object->Scale(Vector, Trans);
}
示例11: Rotate
void Triangle::Rotate(const Vector3d&, const TRANSFORM *tr)
{
if (!Test_Flag(this, DEGENERATE_FLAG))
{
Transform(tr);
}
}
示例12: MInvTransPoint
bool IsoSurface::Inside(const Vector3d& IPoint, TraceThreadData *Thread) const
{
Vector3d New_Point;
/* Transform the point into box space. */
if(Trans != NULL)
MInvTransPoint(New_Point, IPoint, Trans);
else
New_Point = IPoint;
if(!container->Inside(New_Point))
return (Test_Flag(this, INVERTED_FLAG));
if(Vector_Function(Thread->functionContext, New_Point) > 0)
return (Test_Flag(this, INVERTED_FLAG));
/* Inside the box. */
return (!Test_Flag(this, INVERTED_FLAG));
}
示例13: Transform
void Triangle::Transform(const TRANSFORM *tr)
{
if(!Test_Flag(this, DEGENERATE_FLAG))
{
MTransPoint(P1, P1, tr);
MTransPoint(P2, P2, tr);
MTransPoint(P3, P3, tr);
Compute_Triangle();
}
}
示例14: MInvTransPoint
bool Superellipsoid::Inside(const Vector3d& IPoint, TraceThreadData *Thread) const
{
DBL val;
Vector3d P;
/* Transform the point into the superellipsoid space. */
MInvTransPoint(P, IPoint, Trans);
val = evaluate_superellipsoid(P);
if (val < EPSILON)
{
return(!Test_Flag(this, INVERTED_FLAG));
}
else
{
return(Test_Flag(this, INVERTED_FLAG));
}
}
示例15: Scale
void Triangle::Scale(const Vector3d& Vector, const TRANSFORM *)
{
if(!Test_Flag(this, DEGENERATE_FLAG))
{
P1 *= Vector;
P2 *= Vector;
P3 *= Vector;
Compute_Triangle();
}
}