예제 #1
0
        protected OctreeNode[][][] _adjacent;      // connected nodes on same level


        //------------------------------------------------------------------------------
        //constructor
        public OctreeNode(int mID, int mDepth, Vectors min, Vectors max, double r, OctreeBranch parent, eOctPos p)
        {
            _id        = mID;
            _depth     = mDepth;
            _bbMax     = new Vectors(max);
            _bbMin     = new Vectors(min);
            _vnorm     = new Vectors();
            _eigenvec2 = new Vectors();
            _eigenvec3 = new Vectors();
            _sigma     = new Vectors();
            _Ipos      = -1;
            _Jpos      = -1;
            _Kpos      = -1;
            _rg        = new Vectors();
            _adjacent  = new OctreeNode[3][][];
            for (int i = 0; i < 3; i++)
            {
                _adjacent[i] = new OctreeNode[3][];
                for (int j = 0; j < 3; j++)
                {
                    _adjacent[i][j] = new OctreeNode[3];
                    for (int k = 0; k < 3; k++)
                    {
                        _adjacent[i][j][k] = null;
                    }
                }
            }
            _radius = r;
            _parent = parent;
            _ePos   = p;
        }
예제 #2
0
        //
        public OctreeBranch(double r, OctreeLeaf l, OctreeBranch parent, eOctPos p)
            : base(l.ID, l.Depth, l.vMin, l.vMax, r, parent, p)
        {
            _pts = new List <int>(l.PtsIdx);

            _chld = new List <OctreeNode>(OctreeNode._OCT);// the oct part
            _DispLstCentreNorm = -1;

            // we dont need to do PCA for Branches they come from leaves
            // which Are already calculated
            _vnorm     = l.Norm;
            _eigenvec2 = l.EigenVec2;
            _eigenvec3 = l.EigenVec3;
            _rg        = l.RadiiGyration;
            _sigma     = l.Sigma;
        }
예제 #3
0
        //------------------------------------------------------------------------------
        // Constructors
        public OctreeLeaf(int ID, int depth, Vectors min, Vectors max, ref List <bool> used, double R, OctreeBranch parent, eOctPos p)
            : base(ID, depth, min, max, R, parent, p)
        {
            PtData.findptsCube(_bbMin, _bbMax, R, p, ref used, parent.PtsIdx, out _pts);

            if (_pts.Count > 0)
            {
                _DisplayListPT  = -1;
                _DisplayListLN  = -1;
                _DisplayListCTN = -1;
                _PCA_result     = false;
                _SurfaceNum     = -1;

                CalculateSigma();

                if (OctreeNode._MINPTSPCA <= NumPts)
                {
                    _PCA_result = DoPCATest();
                }
            }
            else
            {
                throw new Exception("Invalid Leaf pts: " + _pts.Count);
            }
        }