ArcObjects Library Reference (Geometry)  

IGeneralMultiPatchInfo Interface

Interface to get infomation of a GeneralMultiPatch.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Description
Read-only property IdCount Get Id Count.
Read-only property IsMaterialTextured Get Is Material textured.
Read-only property MaterialColor Get material color.
Read-only property MaterialCount Get Material Count.
Read-only property MaterialCullBackface Get backface culling enabled,
Read-only property MaterialTextureBytesPerPixel Get Material texture bytes per pixel.
Read-only property MaterialTextureColumnCount Get Material texture column count.
Read-only property MaterialTexturePixelColor Get Material texture pixel color.
Read-only property MaterialTextureRowCount Get Material texture row count.
Read-only property MaterialTransparencyPercent Get transparency %, in range of 0 - 100
Read-only property MCount Get M Count.
Read-only property NormalCount Get Normal Count.
Read-only property PatchCount Get Patch Count.
Read-only property PatchM Get M for patch at vertex index.
Read-only property PatchMaterialIndex Get patch material index.
Read-only property PatchPriority Get patch priority.
Read-only property PatchTextureVertex Get Texture WKSPoint for a patch at vertex index.
Read-only property PatchTextureVertexCount Get texture vertex count for a patch.
Read-only property PatchType Get patch type.
Read-only property PatchVertex Get Point for patch at vertex index.
Read-only property PatchVertexCount Get count of vertices in patch.
Read-only property PatchVertexID Get vertex Id for a patch at vertex index.
Method QueryPatchNormal Copies the Normal for patch at specified vertex index into the input vector.
Read-only property TextureVertexCount Get Texture Vertex Count.
Read-only property VertexCount Get Vertex Count.

CoClasses that implement IGeneralMultiPatchInfo

CoClasses and Classes Description
MultiPatch A collection of surface patches.

Remarks

Use this interface to obtain a multipatch's geometry information, including those of its geometry material, if any.

[C#]

        public static void MultiPatchToString(IMultiPatch multiPatch)

        {

            IGeneralMultiPatchInfo generalMultiPatchInfo = multiPatch as IGeneralMultiPatchInfo;

 

            int materialCount = generalMultiPatchInfo.MaterialCount;

            int patchCount = generalMultiPatchInfo.PatchCount;

 

            Trace.WriteLine("----------------------");

            Trace.WriteLine("High Level Description");

            Trace.WriteLine("----------------------");

            Trace.WriteLine("Material Count: " + materialCount);

            Trace.WriteLine("Patch Count: " + patchCount);

            Trace.WriteLine("   Point Count: " + generalMultiPatchInfo.VertexCount);

            Trace.WriteLine("   M Count: " + generalMultiPatchInfo.MCount);

            Trace.WriteLine("   ID Count: " + generalMultiPatchInfo.IdCount);

            Trace.WriteLine("   Normal Count: " + generalMultiPatchInfo.NormalCount);

            Trace.WriteLine("   Texture Point Count: " + generalMultiPatchInfo.TextureVertexCount);

 

            Trace.WriteLine("---------------------");

            Trace.WriteLine("Low Level Description");

            Trace.WriteLine("---------------------");

            Trace.WriteLine("Materials: ");

 

            for (int materialIndex = 0; materialIndex < materialCount; materialIndex++)

            {

                Trace.WriteLine("   Material " + materialIndex + ": ");

                Trace.WriteLine("       Color: " + generalMultiPatchInfo.get_MaterialColor(materialIndex));

                Trace.WriteLine("       Texture: ");

                Trace.WriteLine("           IsTextured: " + generalMultiPatchInfo.get_IsMaterialTextured(materialIndex));

                                               

                int columnCount = generalMultiPatchInfo.get_MaterialTextureColumnCount(materialIndex);

                int rowCount = generalMultiPatchInfo.get_MaterialTextureRowCount(materialIndex);

                int bytesPerPixel = generalMultiPatchInfo.get_MaterialTextureBytesPerPixel(materialIndex);

 

                Trace.WriteLine("           RowCount: " + rowCount);

                Trace.WriteLine("           ColumnCount: " + columnCount);

                Trace.WriteLine("           BytesPerPixel: " + bytesPerPixel);

 

                double sizeInKB = (double)rowCount * (double)columnCount * (double)bytesPerPixel * Math.Pow(10, -3);

 

                Trace.WriteLine("           SizeInKB: " + sizeInKB);

 

                for (int rowIndex = 0; rowIndex < rowCount; rowIndex++)

                {

                    for (int columnIndex = 0; columnIndex < columnCount; columnIndex++)

                    {

                        Trace.WriteLine("               Pixel (" + rowIndex + ", " + columnIndex + "): ");

                        Trace.WriteLine("                   Color: " + generalMultiPatchInfo.get_MaterialTexturePixelColor(materialIndex, rowIndex, columnIndex));

                    }

                }

 

                Trace.WriteLine("       TransparencyPercent: " + generalMultiPatchInfo.get_MaterialTransparencyPercent(materialIndex));

                Trace.WriteLine("       IsBackfaceCulled: " + generalMultiPatchInfo.get_MaterialCullBackface(materialIndex));

            }

 

            Trace.WriteLine("Patches: ");

 

            for (int patchIndex = 0; patchIndex < patchCount; patchIndex++)

            {

                Trace.WriteLine("   Patch " + patchIndex + ": ");

                Trace.WriteLine("       Type: " + generalMultiPatchInfo.get_PatchType(patchIndex));

                Trace.WriteLine("       Priority: " + generalMultiPatchInfo.get_PatchPriority(patchIndex));

                Trace.WriteLine("       MaterialIndex: " + generalMultiPatchInfo.get_PatchMaterialIndex(patchIndex));

 

                int pointCount = generalMultiPatchInfo.get_PatchVertexCount(patchIndex);

 

                Trace.WriteLine("       PointCount: " + pointCount);

 

                for (int pointIndex = 0; pointIndex < pointCount; pointIndex++)

                {

                    WKSPointZ point = generalMultiPatchInfo.get_PatchVertex(patchIndex, pointIndex);

 

                    Trace.WriteLine("           Point " + pointIndex + ": ");

                    Trace.WriteLine("               X: " + point.X);

                    Trace.WriteLine("               Y: " + point.Y);

                    Trace.WriteLine("               Z: " + point.Z);

 

                    double m = generalMultiPatchInfo.get_PatchM(patchIndex, pointIndex);

                    int id = generalMultiPatchInfo.get_PatchVertexID(patchIndex, pointIndex);

 

                    Trace.WriteLine("               M: " + m);

                    Trace.WriteLine("               ID: " + id);

 

                    IVector3D normalVector3D = new Vector3DClass();

                    generalMultiPatchInfo.QueryPatchNormal(patchIndex, pointIndex, normalVector3D);

 

                    Trace.WriteLine("               Normal: ");

                    Trace.WriteLine("                   XComponent: " + normalVector3D.XComponent);

                    Trace.WriteLine("                   YComponent: " + normalVector3D.YComponent);

                    Trace.WriteLine("                   ZComponent: " + normalVector3D.ZComponent);

                }

 

                int texturePointCount = generalMultiPatchInfo.get_PatchTextureVertexCount(patchIndex);

 

                Trace.WriteLine("       TexturePointCount: " + texturePointCount);

                                       

                for (int texturePointIndex = 0; texturePointIndex < texturePointCount; texturePointIndex++)

                {

                    WKSPoint texturePoint = generalMultiPatchInfo.get_PatchTextureVertex(patchIndex, texturePointIndex);

 

                    Trace.WriteLine("           TexturePoint " + texturePointIndex + ": ");

                    Trace.WriteLine("               S: " + texturePoint.X);

                    Trace.WriteLine("               T: " + texturePoint.Y);

                }

            }

        }