Exemple #1
0
 public Proxy(int tIndex, Point3d tPosition, Vector3f tNormal, int tSeedFaceOIndex, int numFacesInMesh, Partition tPartition)//proxy created from initial seed
 {
     index = tIndex;
     rhinoPlane = new Plane(tPosition, tNormal);
     rhinoPlane.Normal.Unitize();
     origin = tPosition;
     seedFaceOIndex = tSeedFaceOIndex;
     hasBeenPoppedInToThis = new bool[numFacesInMesh];
     UsefulFunctions.setAllArrayTo(false,hasBeenPoppedInToThis);
     hasBeenPoppedInToThis[seedFaceOIndex] = true; //set seed to popped
     assignedFaces = new List<int>();
     assignedFaces.Add(seedFaceOIndex);//add this first face
     partition = tPartition;
     if (partition.controller.metricRef == 0)
     {
         partition.addToQueueInOrder(new PoppedFaceInfo(errorMetricEuclidean(seedFaceOIndex), seedFaceOIndex, index));
     }
     else
     {
         partition.addToQueueInOrder(new PoppedFaceInfo(errorMetric21(seedFaceOIndex), seedFaceOIndex, index));
     }
 }
Exemple #2
0
 public Proxy(int tIndex, Point3d tPosition, Vector3f tNormal, int tSeedFaceOIndex, int numFacesInMesh, Partition tPartition)//proxy created from initial seed
 {
     index      = tIndex;
     rhinoPlane = new Plane(tPosition, tNormal);
     rhinoPlane.Normal.Unitize();
     origin                = tPosition;
     seedFaceOIndex        = tSeedFaceOIndex;
     hasBeenPoppedInToThis = new bool[numFacesInMesh];
     UsefulFunctions.setAllArrayTo(false, hasBeenPoppedInToThis);
     hasBeenPoppedInToThis[seedFaceOIndex] = true; //set seed to popped
     assignedFaces = new List <int>();
     assignedFaces.Add(seedFaceOIndex);            //add this first face
     partition = tPartition;
     if (partition.controller.metricRef == 0)
     {
         partition.addToQueueInOrder(new PoppedFaceInfo(errorMetricEuclidean(seedFaceOIndex), seedFaceOIndex, index));
     }
     else
     {
         partition.addToQueueInOrder(new PoppedFaceInfo(errorMetric21(seedFaceOIndex), seedFaceOIndex, index));
     }
 }
Exemple #3
0
        internal void popFace(int indexToPop)
        {
            Face faceToPop = partition.controller.wingMesh.faces[indexToPop];

            for (int i = 0; i < faceToPop.surroundingFaceIndices.Count; i++)
            {
                if (faceToPop.surroundingFaceIndices[i] != -1)
                {
                    if (!hasBeenPoppedInToThis[faceToPop.surroundingFaceIndices[i]])//check the added face hasn't already been added to priority with ref to this proxy
                    {
                        if (partition.controller.metricRef == 0)
                        {
                            partition.addToQueueInOrder(new PoppedFaceInfo(errorMetricEuclidean(faceToPop.surroundingFaceIndices[i]), faceToPop.surroundingFaceIndices[i], index));
                            hasBeenPoppedInToThis[faceToPop.surroundingFaceIndices[i]] = true;
                        }
                        else
                        {//do other ref - make this an ennumeration if more added..
                            partition.addToQueueInOrder(new PoppedFaceInfo(errorMetric21(faceToPop.surroundingFaceIndices[i]), faceToPop.surroundingFaceIndices[i], index));
                            hasBeenPoppedInToThis[faceToPop.surroundingFaceIndices[i]] = true;
                        }
                    }
                }
            }
        }