Exemplo n.º 1
0
        protected double PopulateSingleCutFacePositiveDirection(ref CrossSection face, GLVector3d CutPoint, int iQuadrant, double fHalfCubeWidth, bool bOuter)
        {
            iQuadrant = NormalizeQuadrant(iQuadrant);

            face.RemoveAllPoints();

            GLVector3d StartPoint = new GLVector3d(CutPoint);
            GLVector3d EndPoint   = null;

            if (iQuadrant < iNumberFaces - 1)
            {
                EndPoint = ReferenceVertices[iQuadrant + 1] * fHalfCubeWidth / 0.5;
            }
            else
            {
                EndPoint = ReferenceVertices[0] * fHalfCubeWidth / 0.5;
            }

            if (bOuter)
            {
                face.AddPoint(StartPoint);
                face.AddPoint(EndPoint);
            }
            else
            {
                face.AddPoint(EndPoint);
                face.AddPoint(StartPoint);
            }
            return((EndPoint - StartPoint).length());
        }
Exemplo n.º 2
0
        protected double PopulateCompleteSide(ref CrossSection face, int iQuadrant, double fHalfCubeWidth, bool bOuter)
        {
            iQuadrant = NormalizeQuadrant(iQuadrant);

            face.RemoveAllPoints();

            GLVector3d StartPoint = ReferenceVertices[iQuadrant];
            GLVector3d EndPoint   = null;

            if (iQuadrant < iNumberFaces - 1)
            {
                EndPoint = ReferenceVertices[iQuadrant + 1];
            }
            else
            {
                EndPoint = ReferenceVertices[0];
            }

            StartPoint = StartPoint * fHalfCubeWidth / 0.5;
            EndPoint   = EndPoint * fHalfCubeWidth / 0.5;

            if (bOuter)
            {
                face.AddPoint(StartPoint.x, StartPoint.y, StartPoint.z);
                face.AddPoint(EndPoint.x, EndPoint.y, EndPoint.z);
            }
            else
            {
                face.AddPoint(EndPoint.x, EndPoint.y, EndPoint.z);
                face.AddPoint(StartPoint.x, StartPoint.y, StartPoint.z);
            }

            return(2 * fHalfCubeWidth);
        }
Exemplo n.º 3
0
        protected GLVector3d[] ReferenceVertices; //!< reference vertices of our prim, to build the crosssections etc

        #endregion Fields

        #region Constructors

        // constructor(s)
        public LinearPrimitive()
        {
            linearextrusionpath = new LinearExtrusionPath();
            linearextrusionpath.LevelOfDetail =  iLevelOfDetail;

            for( int i = 0; i < 4; i++ )
            {
                OuterFaces[i] = new CrossSection();
                InnerFaces[i] = new CrossSection();
            }
            CutFaces[0] = new CrossSection();
            CutFaces[1] = new CrossSection();
        }
Exemplo n.º 4
0
        // constructor(s)
        public LinearPrimitive()
        {
            linearextrusionpath = new LinearExtrusionPath();
            linearextrusionpath.LevelOfDetail = iLevelOfDetail;

            for (int i = 0; i < 4; i++)
            {
                OuterFaces[i] = new CrossSection();
                InnerFaces[i] = new CrossSection();
            }
            CutFaces[0] = new CrossSection();
            CutFaces[1] = new CrossSection();
        }
Exemplo n.º 5
0
        // constructors

        public RotationalPrimitive()
        {
            for (int i = 0; i < 4; i++)
            {
                OuterFaces[i] = new CrossSection();
                InnerFaces[i] = new CrossSection();
            }
            CutFaces[0] = new CrossSection();
            CutFaces[1] = new CrossSection();

            rotationalextrusionpath = new RotationalExtrusionPath();
            rotationalextrusionpath.LevelOfDetail = iLevelOfDetail;

            UpdateExtrusionScaling();
        }
Exemplo n.º 6
0
        // constructors
        public RotationalPrimitive()
        {
            for( int i = 0; i < 4; i++ )
            {
                OuterFaces[i] = new CrossSection();
                InnerFaces[i] = new CrossSection();
            }
            CutFaces[0] = new CrossSection();
            CutFaces[1] = new CrossSection();

            rotationalextrusionpath = new RotationalExtrusionPath();
            rotationalextrusionpath.LevelOfDetail = iLevelOfDetail;

            UpdateExtrusionScaling();
        }
Exemplo n.º 7
0
        // Handles the first face in the cut, starting from cutstart, and running anticlockwise to first reference vertex (assuming x points right, y points up)
        double PopulateSingleCutFacePositiveDirection( ref CrossSection face, GLVector3d CutPoint, int iQuadrant, double fHalfCubeWidth, bool bOuter )
        {
            iQuadrant = NormalizeQuadrant( iQuadrant );

            face.RemoveAllPoints();

            GLVector3d StartPoint = new GLVector3d( CutPoint );
            GLVector3d EndPoint = null;
            if( iQuadrant < iNumberFaces - 1 )
            {
                EndPoint = ReferenceVertices[ iQuadrant + 1 ] * fHalfCubeWidth / 0.5;
            }
            else
            {
                EndPoint = ReferenceVertices[ 0 ] * fHalfCubeWidth / 0.5;
            }

            if( bOuter )
            {
                face.AddPoint( StartPoint );
                face.AddPoint( EndPoint );
            }
            else
            {
                face.AddPoint( EndPoint );
                face.AddPoint( StartPoint );
            }
            return ( EndPoint - StartPoint ).length();
        }
Exemplo n.º 8
0
        double PopulateCompleteSide( ref CrossSection face, int iQuadrant, double fHalfCubeWidth, bool bOuter )
        {
            iQuadrant = NormalizeQuadrant( iQuadrant );

            face.RemoveAllPoints();

            GLVector3d StartPoint = ReferenceVertices[ iQuadrant ];
            GLVector3d EndPoint = null;
            if( iQuadrant < iNumberFaces - 1 )
            {
                EndPoint = ReferenceVertices[ iQuadrant + 1 ];
            }
            else
            {
                EndPoint = ReferenceVertices[ 0 ];
            }

            StartPoint = StartPoint * fHalfCubeWidth / 0.5;
            EndPoint = EndPoint * fHalfCubeWidth / 0.5;

            if( bOuter )
            {
                face.AddPoint( StartPoint.x, StartPoint.y, StartPoint.z );
                face.AddPoint( EndPoint.x, EndPoint.y, EndPoint.z );
            }
            else
            {
                face.AddPoint( EndPoint.x, EndPoint.y, EndPoint.z );
                face.AddPoint( StartPoint.x, StartPoint.y, StartPoint.z );
            }

            return 2 * fHalfCubeWidth;
        }