internal void ChangeEdgeStyle(ElementMode mode, GrLineStyle style)
 {
     edgeRealizers[(int)mode] = GetEdgeRealizer(
         edgeRealizers[(int)mode].Color,
         edgeRealizers[(int)mode].TextColor,
         edgeRealizers[(int)mode].LineWidth,
         style);
 }
 internal void ChangeEdgeTextColor(ElementMode mode, GrColor textColor)
 {
     edgeRealizers[(int)mode] = GetEdgeRealizer(
         edgeRealizers[(int)mode].Color,
         textColor,
         edgeRealizers[(int)mode].LineWidth,
         edgeRealizers[(int)mode].LineStyle);
 }
 internal void ChangeEdgeThickness(ElementMode mode, int thickness)
 {
     edgeRealizers[(int)mode] = GetEdgeRealizer(
         edgeRealizers[(int)mode].Color,
         edgeRealizers[(int)mode].TextColor,
         thickness,
         edgeRealizers[(int)mode].LineStyle);
 }
 internal void ChangeNodeShape(ElementMode mode, GrNodeShape shape)
 {
     nodeRealizers[(int)mode] = GetNodeRealizer(
         nodeRealizers[(int)mode].Color,
         nodeRealizers[(int)mode].BorderColor,
         nodeRealizers[(int)mode].TextColor,
         shape);
 }
 internal void ChangeNodeTextColor(ElementMode mode, GrColor textColor)
 {
     nodeRealizers[(int)mode] = GetNodeRealizer(
         nodeRealizers[(int)mode].Color,
         nodeRealizers[(int)mode].BorderColor,
         textColor,
         nodeRealizers[(int)mode].Shape);
 }
 public PathElements(IElement element, IGeometry elementGeometry, ElementMode elementMode, double height)
 {
     if (elementGeometry.GeometryType == esriGeometryType.esriGeometryPolyline)
     {
         if (elementMode == ElementMode.Element2D)
         {
             _element = Get2DElementTemporaryPath(element, elementGeometry);
         }
         else
         {
             _element           = Get3DElementTemporaryPath(element, elementGeometry);
             _elementProperties = Get3DElementProperties(height);
         }
     }
 }
Beispiel #7
0
        void SetElementMode(ElementMode mode)
        {
            elementMode = mode;

            if (selection.mesh.handlesRenderer.material != null)
            {
                DestroyImmediate(selection.mesh.handlesRenderer.material);
            }

            selection.mesh.handlesRenderer.material = new Material(Shader.Find(mode == ElementMode.Vertex ? "Hidden/QuickEdit/VertexShader" : "Hidden/QuickEdit/FaceShader"));

            if (elementMode == ElementMode.Vertex)
            {
                selection.mesh.handlesRenderer.material.SetFloat("_Scale", 2f);
            }

            selection.mesh.handlesRenderer.material.hideFlags = HideFlags.HideAndDontSave;

            CacheIndicesForGraphics();

            UpdateGraphics();
        }
Beispiel #8
0
        void DrawWindow(int id)
        {
            EditorGUI.BeginChangeCheck();

            elementMode = (ElementMode)GUI.Toolbar(toolbarRect, (int)elementMode, SelectionIcons, "Command");

            if (EditorGUI.EndChangeCheck())
            {
                SetElementMode(elementMode);
            }

            GUILayout.Space(24);

            GUILayout.BeginHorizontal();
            if (GUILayout.Button(gc_RebuildNormals, EditorStyles.miniButtonLeft))
            {
                qeUtil.RecordMeshUndo(selection.mesh, "Rebuild Normals");
                qe_Mesh_Utility.RebuildNormals(selection.mesh);
            }

            if (GUILayout.Button(gc_RebuildUV2, EditorStyles.miniButtonRight))
            {
                qeUtil.RecordMeshUndo(selection.mesh, "Rebuild UV2");
                qe_Mesh_Utility.RebuildUV2(selection.mesh);
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button(gc_Facetize, EditorStyles.miniButtonLeft))
            {
                qeUtil.RecordMeshUndo(selection.mesh, "Facetize");

                qe_Mesh_Utility.Facetize(selection.mesh);
                selection.CacheMeshValues();
            }

            if (GUILayout.Button(gc_RebuildColliders, EditorStyles.miniButtonRight))
            {
                qeUtil.RecordMeshUndo(selection.mesh, "Rebuild Collision Mesh");
                qe_Mesh_Utility.RebuildColliders(selection.mesh);
            }
            GUILayout.EndHorizontal();

            if (GUILayout.Button(gc_CenterPivot, EditorStyles.miniButton))
            {
                qeUtil.RecordMeshUndo(selection.mesh, "Center Pivot");
                Vector3 offset = qe_Mesh_Utility.CenterPivot(selection.mesh.cloneMesh);
                Undo.RecordObject(selection.transform, "Center Pivot");
                selection.transform.position += offset;
                selection.CacheMeshValues();
            }

            if (GUILayout.Button(gc_DeleteFaces, EditorStyles.miniButton) && selection.faces.Count > 0)
            {
                qeUtil.RecordMeshUndo(selection.mesh, "Delete Faces");

                if (qe_Mesh_Utility.DeleteTriangles(selection.mesh, selection.faces))
                {
                    selection.Clear();
                    selection.CacheMeshValues();
                    CacheIndicesForGraphics();
                    UpdateGraphics();
                }
            }


            if (GUILayout.Button("Cancel", EditorStyles.miniButton))
            {
                Finish(ExitStatus.DoNotSave);
            }

            if (GUILayout.Button("Save", EditorStyles.miniButton))
            {
                Finish(ExitStatus.Save);
            }


            GUI.DragWindow(QE_WINDOW_DRAG_RECT);

 #if DO_THE_DEBUG_DANCE
            scroll = GUILayout.BeginScrollView(scroll);
            if (selection.mesh != null)
            {
                GUILayout.Label("Source: " + selection.mesh.source);
                GUILayout.Label("GUID: " + selection.mesh.originalMeshGUID);
                GUILayout.Label("Clone: " + selection.mesh.cloneMesh.name);
                GUILayout.Label("Original: " + selection.mesh.originalMesh.name);

                GUILayout.Label("Vertex Count: " + selection.mesh.cloneMesh.vertexCount);
                GUILayout.Label("Triangle Count: " + selection.mesh.cloneMesh.triangles.Length);
            }
            else
            {
                GUILayout.Label("Source: NULL");
            }
            GUILayout.EndScrollView();
#endif
        }
        public AirplaneElements(IElement element, IGeometry elementGeometry, ICurve curvePath, ElementMode elementMode, double markerSize, double height)
        {
            this.fileName2DElement = @"C:\Users\mgh\Desktop\AirPlane2\Graphics\1.png";
            this.fileName3DElement = @"C:\Users\mgh\Desktop\AirPlane2\Graphics\11_2\13.3ds";

            if (elementGeometry.GeometryType == esriGeometryType.esriGeometryPoint)
            {
                if (elementMode == ElementMode.Element2D)
                {
                    _element = Get2DElementAirplane(element, elementGeometry, curvePath, markerSize);
                }
                else
                {
                    _element           = Get3DElementAirplane(element, elementGeometry, curvePath, markerSize);
                    _elementProperties = Get3DElementProperties(height);
                }
            }
        }
 public ElementDefinitionAttribute(ElementMode mode, int locator, params string[] path)
 {
     this.path = path;
     this.locator = locator;
     this.mode = mode;
 }