Esempio n. 1
0
        public void UpdateBrushPreview(Frame3f vFrameS, int nHitElementID, MeshEditorOpType.ElementType elemType)
        {
            Frame3f vFrameL = SceneTransforms.SceneToObject(Target, vFrameS);

            update_preview(vFrameL, nHitElementID, elemType);

            lastBrushPosS = vFrameS;
        }
Esempio n. 2
0
        public void UpdateStroke(Frame3f vFrameS, int nHitElementID, MeshEditorOpType.ElementType elemType)
        {
            if (in_stroke == false)
            {
                throw new Exception("MeshEditorTool.UpdateBrushStroke: not in brush stroke!");
            }

            Frame3f vFrameL = SceneTransforms.SceneToObject(Target, vFrameS);

            update_stroke(vFrameL, nHitElementID, elemType);

            lastBrushPosS = vFrameS;
        }
Esempio n. 3
0
        bool update_last_hit(MeshEditorTool tool, Ray3f rayS)
        {
            int hit_id = -1; Frame3f hitFrameS = Frame3f.Identity;

            MeshEditorOpType.ElementType hitType = MeshEditorOpType.ElementType.Triangle;
            if (tool.FindHitElement(rayS, ref hitFrameS, ref hit_id, ref hitType))
            {
                lastHitFrameS      = hitFrameS;
                lastHitElementID   = hit_id;
                lastHitElementType = hitType;
                return(true);
            }
            return(false);
        }
Esempio n. 4
0
        public void BeginStroke(Frame3f vFrameS, int nHitElementID, MeshEditorOpType.ElementType elemType)
        {
            if (in_stroke)
            {
                throw new Exception("MeshEditorTool.BeginBrushStroke: already in brush stroke!");
            }

            Frame3f vFrameL = SceneTransforms.SceneToObject(Target, vFrameS);

            begin_stroke(vFrameL, nHitElementID, elemType);

            in_stroke     = true;
            lastBrushPosS = vFrameS;
        }
Esempio n. 5
0
 public bool FindHitElement(Ray3f sceneRay, ref Frame3f hitFrameS, ref int hitID, ref MeshEditorOpType.ElementType elemType)
 {
     if (activeOp.MeshElement == MeshEditorOpType.ElementType.Triangle)
     {
         elemType = MeshEditorOpType.ElementType.Triangle;
         return(FindHitTriangle(sceneRay, activeOp.SnapToElement, ref hitFrameS, ref hitID));
     }
     else if (activeOp.MeshElement == MeshEditorOpType.ElementType.Edge)
     {
         elemType = MeshEditorOpType.ElementType.Edge;
         return(FindHitEdge(sceneRay, activeOp.BoundaryFilter, activeOp.SnapToElement, ref hitFrameS, ref hitID));
     }
     else if (activeOp.MeshElement == MeshEditorOpType.ElementType.Vertex)
     {
         elemType = MeshEditorOpType.ElementType.Vertex;
         return(FindHitVertex(sceneRay, activeOp.BoundaryFilter, ref hitFrameS, ref hitID));
     }
     else
     {
         return(false);
     }
 }
Esempio n. 6
0
 protected virtual void update_preview(Frame3f vLocalF, int nHitElementID, MeshEditorOpType.ElementType elemType)
 {
     activeOp.UpdatePreview(vLocalF, nHitElementID, elemType);
 }
Esempio n. 7
0
 protected virtual void begin_stroke(Frame3f vStartFrameL, int nHitElementID, MeshEditorOpType.ElementType elemType)
 {
     activeOp.Editor = this;
     activeOp.BeginStroke(vStartFrameL, nHitElementID, elemType);
 }