Exemplo n.º 1
0
        public PrimitiveRenderer(EditablePoly editablePoly)
        {
            this.editablePoly = editablePoly;
            this.batchRenderer = new TrianglesBatchRenderer();

            this.vertexBox = TgcBox.fromSize(new Vector3(1, 1, 1), Color.Blue);
            this.selectedVertexBox = TgcBox.fromSize(new Vector3(1, 1, 1), Color.Red);
        }
Exemplo n.º 2
0
        public PrimitiveRenderer(EditablePoly editablePoly)
        {
            this.editablePoly  = editablePoly;
            this.batchRenderer = new TrianglesBatchRenderer();

            this.vertexBox         = TgcBox.fromSize(new Vector3(1, 1, 1), Color.Blue);
            this.selectedVertexBox = TgcBox.fromSize(new Vector3(1, 1, 1), Color.Red);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Setear estado EditablePoly
        /// </summary>
        /// <param name="enabled"></param>
        public void setEditablePolyEnable(bool enabled, EditablePoly.PrimitiveType primitiveType)
        {
            if (enabled)
            {
                currentState = State.EditablePoly;
                groupBoxEPolyCommon.Enabled = true;
                creatingPrimitive = null;
                currentGizmo = null;
                MeshPrimitive m = (MeshPrimitive)selectionList[0];
                m.enableEditablePoly(true, primitiveType);
            }
            else
            {
                if (currentState == State.EditablePoly)
                {
                    MeshPrimitive m = (MeshPrimitive)selectionList[0];
                    m.enableEditablePoly(false, primitiveType);

                    radioButtonEPolyPrimitiveVertex.Checked = false;
                    radioButtonEPolyPrimitiveEdge.Checked = false;
                    radioButtonEPolyPrimitivePolygon.Checked = false;
                    groupBoxEPolyCommon.Enabled = false;
                    groupBoxEPolyEditVertices.Enabled = false;
                    groupBoxEPolyEditEdges.Enabled = false;
                    groupBoxEPolyEditPolygons.Enabled = false;

                    setSelectObjectState();
                }
            }
        }
 public EditablePolyTranslateGizmo(EditablePoly editablePoly)
 {
     this.editablePoly = editablePoly;
     gizmoMesh = new TranslateGizmoMesh();
     currentState = State.Init;
 }
Exemplo n.º 5
0
 public override void dispose()
 {
     mesh.dispose();
     mesh = null;
     originalUVCoords = null;
     if (editablePoly != null)
     {
         editablePoly.dispose();
         editablePoly = null;
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Activar/Desactivar modo editablePoly
 /// </summary>
 public void enableEditablePoly(bool enabled, EditablePoly.PrimitiveType primitiveType)
 {
     if (enabled)
     {
         if (editablePoly == null)
         {
             editablePoly = new EditablePoly(this.Control, mesh);
         }
         else
         {
             editablePoly.updateValuesFromMesh(mesh);
         }
         editablePoly.setPrimitiveType(primitiveType);
     }
     else
     {
         //Acomodar mesh luego de haber sido editado internamente
         applyMeshTransformToVertices(mesh);
         setMeshToOrigin();
     }
     editablePolyEnabled = enabled;
 }
 public EditablePolyTranslateGizmo(EditablePoly editablePoly)
 {
     this.editablePoly = editablePoly;
     gizmoMesh         = new TranslateGizmoMesh();
     currentState      = State.Init;
 }