コード例 #1
0
ファイル: EditableMesh.cs プロジェクト: jcoder58/Plugins
 ///<summary>Get Vertex Connected Polygons</summary>
 public IReadOnlyCollection <PolygonID> GetVertexConnectedPolygons(VertexID VertexID) =>
 EditableMesh_methods.GetVertexConnectedPolygons_method.Invoke(ObjPointer, VertexID);
コード例 #2
0
ファイル: EditableMesh.cs プロジェクト: jcoder58/Plugins
 ///<summary>Get Vertex Pair Edge</summary>
 public (bool, EdgeID) GetVertexPairEdge(VertexID VertexID, VertexID NextVertexID) =>
コード例 #3
0
ファイル: EditableMesh.cs プロジェクト: jcoder58/Plugins
 ///<summary>Returns the number of edges connected to this vertex</summary>
 public int GetVertexConnectedEdgeCount(VertexID VertexID) =>
 EditableMesh_methods.GetVertexConnectedEdgeCount_method.Invoke(ObjPointer, VertexID);
コード例 #4
0
ファイル: EditableMesh.cs プロジェクト: jcoder58/Plugins
 ///<summary>Get Vertex Connected Edges</summary>
 public IReadOnlyCollection <EdgeID> GetVertexConnectedEdges(VertexID VertexID) =>
 EditableMesh_methods.GetVertexConnectedEdges_method.Invoke(ObjPointer, VertexID);
コード例 #5
0
ファイル: EditableMesh.cs プロジェクト: jcoder58/Plugins
 ///<summary>Get Vertex Adjacent Vertices</summary>
 public IReadOnlyCollection <VertexID> GetVertexAdjacentVertices(VertexID VertexID) =>
 EditableMesh_methods.GetVertexAdjacentVertices_method.Invoke(ObjPointer, VertexID);
コード例 #6
0
ファイル: EditableMesh.cs プロジェクト: jcoder58/Plugins
 ///<summary>Returns the requested edge connected to this vertex</summary>
 public EdgeID GetVertexConnectedEdge(VertexID VertexID, int ConnectedEdgeNumber) =>
 EditableMesh_methods.GetVertexConnectedEdge_method.Invoke(ObjPointer, VertexID, ConnectedEdgeNumber);
コード例 #7
0
ファイル: EditableMesh.cs プロジェクト: jcoder58/Plugins
 ///<summary>Find Polygon Perimeter Vertex Number for Vertex</summary>
 public int FindPolygonPerimeterVertexNumberForVertex(PolygonID PolygonID, VertexID VertexID) =>
 EditableMesh_methods.FindPolygonPerimeterVertexNumberForVertex_method.Invoke(ObjPointer, PolygonID, VertexID);
コード例 #8
0
ファイル: XMLBulkImportPlugin.cs プロジェクト: cosh/sones
 public Link(VertexID myTargetID, IDictionary<String, String> myValues)
 {
     TargetID = myTargetID;
     Values = myValues;
 }
コード例 #9
0
ファイル: EditableMesh.cs プロジェクト: jcoder58/Plugins
 ///<summary>Find Polygon Hole Vertex Number for Vertex</summary>
 public int FindPolygonHoleVertexNumberForVertex(PolygonID PolygonID, int HoleNumber, VertexID VertexID) =>
 EditableMesh_methods.FindPolygonHoleVertexNumberForVertex_method.Invoke(ObjPointer, PolygonID, HoleNumber, VertexID);
コード例 #10
0
ファイル: EditableMesh.cs プロジェクト: jcoder58/Plugins
 ///<summary>Find Polygon Perimeter Edge Number for Vertices</summary>
 public int FindPolygonPerimeterEdgeNumberForVertices(PolygonID PolygonID, VertexID EdgeVertexID0, VertexID EdgeVertexID1) =>
 EditableMesh_methods.FindPolygonPerimeterEdgeNumberForVertices_method.Invoke(ObjPointer, PolygonID, EdgeVertexID0, EdgeVertexID1);
コード例 #11
0
ファイル: EditableMesh.cs プロジェクト: jcoder58/Plugins
 ///<summary>Delete Vertex and Connected Edges and Polygons</summary>
 public void DeleteVertexAndConnectedEdgesAndPolygons(VertexID VertexID, bool bDeleteOrphanedEdges, bool bDeleteOrphanedVertices, bool bDeleteOrphanedVertexInstances, bool bDeleteEmptyPolygonGroups) =>
 EditableMesh_methods.DeleteVertexAndConnectedEdgesAndPolygons_method.Invoke(ObjPointer, VertexID, bDeleteOrphanedEdges, bDeleteOrphanedVertices, bDeleteOrphanedVertexInstances, bDeleteEmptyPolygonGroups);
コード例 #12
0
        void uploadVertices(IDeviceContext ic, Span <sDrawCall> drawCallsSpan)
        {
            ReadOnlySpan <int> baseVertices = buffersLayout.baseVertices;

            using (var mapped = resources.getVertexBuffer().map <sVertexWithId>(ic, buffersLayout.vertexBufferSize))
            {
                Span <sVertexWithId> span = mapped.span;

                for (int i = 0; i < drawCallsSpan.Length; i++)
                {
                    int bv = baseVertices[i];
                    if (bv < 0)
                    {
                        continue;                           // Empty draw call, i.e. completely clipped out
                    }
                    Span <sVertexWithId> dest = span.Slice(bv);

                    ref var dc = ref drawCallsSpan[i];
                    uint    id = VertexID.vertex(i);
                    int     sn = dc.order.sn;
                    if (sn >= 0)
                    {
                        drawMeshes.meshes[sn].mesh.mesh.copyVertices(dest, id);
                        continue;
                    }
                    sn = -sn - 1;

                    if (dc.drawCall.mesh == eMesh.SpriteRectangle)
                    {
                        Rect rc = drawMeshes.spriteCommands[sn].rect;
                        SpriteMesh.writeVertices(dest, ref rc, id);
                        continue;
                    }

                    if (dc.drawCall.isText)
                    {
                        var           text = drawMeshes.textCommands[sn];
                        sMeshDataSize mds;
                        if (text.consoleWidth.HasValue)
                        {
                            mds = text.font.renderConsole(dest, id, text.text, text.rectangle.topLeft, text.textRendering, text.consoleWidth.Value);
                        }
                        else
                        {
                            mds = text.font.renderBlock(dest, id, text.text, ref text.rectangle, text.textRendering);
                        }

                        Debug.Assert(mds.vertices <= text.meshDataSize.vertices && mds.triangles <= text.meshDataSize.triangles);
                        // Store the actual count of triangles written.
                        // uploadIndices function needs it later, to fill unused portion of the index buffer with UINT_MAX (32 bit IB) or 0xFFFF (16 bit IB) discarding the data.
                        // Technically that's wasted GPU bandwidth, however:
                        // (a) Not much of it, as normal text only contains a few of these soft hyphens and ligatures.
                        // (b) Saves substantial amount of resources allowing to generate the complete mesh with a single pass over the glyphs.
                        // With exact-sized buffers, we would have to build the complete text mesh in managed memory, then copy to GPU.
                        // Current implementation only buffers 1 word for left aligned blocks, or 1 line for middle or right aligned blocks, or nothing at all for single-line text. The vertices go straight to mapped GPU verftex buffer.
                        text.actualTriangles        = mds.triangles;
                        drawMeshes.textCommands[sn] = text;

                        // dbgPrintGlyphVertices( dest );
                        continue;
                    }

                    sDrawRectCommand cmd = drawMeshes.rectCommands[sn];
                    if (cmd.strokeWidth.HasValue)
                    {
                        RectangleMesh.strokedVertices(dest, id, ref cmd.rect, cmd.strokeWidth.Value);
                    }
                    else
                    {
                        RectangleMesh.filledVertices(dest, id, ref cmd.rect);
                    }
                }
            }
コード例 #13
0
ファイル: XMLBulkImportPlugin.cs プロジェクト: cosh/sones
 /// <summary>
 /// Converts a instance of VertexID into an instance of VertexInformation.
 /// </summary>
 /// <param name="myVertexID">An instance of VertexID that will be converted.</param>
 /// <returns>An instance of VertexInformation.</returns>
 /// <exception cref="NullReferenceException">If <paramref name="myVertexID"/> is <c>Null</c>.</exception>
 private VertexInformation ConvertVertexID(VertexID myVertexID)
 {
     return new VertexInformation(RetrieveVertexType(myVertexID.VertexType).ID, myVertexID.ID);
 }
コード例 #14
0
ファイル: EditableMesh.cs プロジェクト: jcoder58/Plugins
 ///<summary>Returns whether the given vertex ID is valid</summary>
 public bool IsValidVertex(VertexID VertexID) =>
 EditableMesh_methods.IsValidVertex_method.Invoke(ObjPointer, VertexID);
コード例 #15
0
ファイル: EditableMesh.cs プロジェクト: jcoder58/Plugins
 ///<summary>Get Edge That Connects Vertices</summary>
 public EdgeID GetEdgeThatConnectsVertices(VertexID VertexID0, VertexID VertexID1) =>
 EditableMesh_methods.GetEdgeThatConnectsVertices_method.Invoke(ObjPointer, VertexID0, VertexID1);
コード例 #16
0
ファイル: EditableMesh.cs プロジェクト: jcoder58/Plugins
 ///<summary>Try to Remove Vertex</summary>
 public (bool, EdgeID) TryToRemoveVertex(VertexID VertexID) =>
コード例 #17
0
 public PointCreators(VertexID first, VertexID second)
 {
     First  = first;
     Second = second;
 }