当前位置: 首页>>代码示例>>C++>>正文


C++ Test_Flag函数代码示例

本文整理汇总了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);
		}
	}
}
开发者ID:Nyoho,项目名称:povray,代码行数:26,代码来源:photonestimationtask.cpp

示例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));
    }
}
开发者ID:SteveShaw,项目名称:povray,代码行数:35,代码来源:sphere.cpp

示例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));
}
开发者ID:SteveShaw,项目名称:povray,代码行数:54,代码来源:sor.cpp

示例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;
    }
}
开发者ID:atlaste,项目名称:povray,代码行数:26,代码来源:lemon.cpp

示例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);
  }
}
开发者ID:carolemieux,项目名称:daikon,代码行数:27,代码来源:triangle.cpp

示例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);
    }
}
开发者ID:hjw3001,项目名称:povray,代码行数:25,代码来源:fractal.cpp

示例7: Rotate_Triangle

static void Rotate_Triangle(OBJECT *Object, VECTOR, TRANSFORM *Trans)
{
  if (!Test_Flag(Object, DEGENERATE_FLAG))
  {
    Transform_Triangle(Object, Trans);
  }
}
开发者ID:carolemieux,项目名称:daikon,代码行数:7,代码来源:triangle.cpp

示例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);
  }
}
开发者ID:carolemieux,项目名称:daikon,代码行数:27,代码来源:triangle.cpp

示例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);
}
开发者ID:atlaste,项目名称:povray,代码行数:30,代码来源:object.cpp

示例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);
}
开发者ID:Degot,项目名称:povray,代码行数:32,代码来源:objects.cpp

示例11: Rotate

void Triangle::Rotate(const Vector3d&, const TRANSFORM *tr)
{
    if (!Test_Flag(this, DEGENERATE_FLAG))
    {
        Transform(tr);
    }
}
开发者ID:SteveShaw,项目名称:povray,代码行数:7,代码来源:triangle.cpp

示例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));
}
开发者ID:quickfur,项目名称:povray,代码行数:19,代码来源:isosurface.cpp

示例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();
    }
}
开发者ID:SteveShaw,项目名称:povray,代码行数:11,代码来源:triangle.cpp

示例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));
    }
}
开发者ID:UberPOV,项目名称:UberPOV,代码行数:20,代码来源:super.cpp

示例15: Scale

void Triangle::Scale(const Vector3d& Vector, const TRANSFORM *)
{
    if(!Test_Flag(this, DEGENERATE_FLAG))
    {
        P1 *= Vector;
        P2 *= Vector;
        P3 *= Vector;

        Compute_Triangle();
    }
}
开发者ID:SteveShaw,项目名称:povray,代码行数:11,代码来源:triangle.cpp


注:本文中的Test_Flag函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。