Interface IGeneralMultiPatchInfo

Namespace
ESRI.ArcGIS.Geometry
Assembly
ESRI.Server.Geometry.dll

Interface to get infomation of a GeneralMultiPatch.

[Guid("69656158-701D-408C-8B6A-A0B4C012C843")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IGeneralMultiPatchInfo

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);

                }

            }

        }

Properties

IdCount

Get Id Count.

int IdCount { get; }

Property Value

int

IsMaterialTextured[int]

Get Is Material textured.

bool IsMaterialTextured[int Index] { get; }

Parameters

Index int

Property Value

bool

MCount

Get M Count.

int MCount { get; }

Property Value

int

MaterialColor[int]

Get material color.

int MaterialColor[int Index] { get; }

Parameters

Index int

Property Value

int

MaterialCount

Get Material Count.

int MaterialCount { get; }

Property Value

int

MaterialCullBackface[int]

Get backface culling enabled,

bool MaterialCullBackface[int Index] { get; }

Parameters

Index int

Property Value

bool

Remarks

Backface Culling is a property acquired through the process of importing 3D models into the MultiPatch format. It cannot currently be set programmatically.

MaterialTextureBytesPerPixel[int]

Get Material texture bytes per pixel.

int MaterialTextureBytesPerPixel[int Index] { get; }

Parameters

Index int

Property Value

int

Remarks

This property shows how many bands exist in a geometry material.  For a geometry material, the minimum value of this property is 1 and the maximum is 4.  The fourth channel is usually the alpha channel used for material pixel transparency - the 'A' in 'RGBA'.

MaterialTextureColumnCount[int]

Get Material texture column count.

int MaterialTextureColumnCount[int Index] { get; }

Parameters

Index int

Property Value

int

MaterialTexturePixelColor[int, int, int]

Get Material texture pixel color.

int MaterialTexturePixelColor[int Index, int row, int column] { get; }

Parameters

Index int
row int
column int

Property Value

int

MaterialTextureRowCount[int]

Get Material texture row count.

int MaterialTextureRowCount[int Index] { get; }

Parameters

Index int

Property Value

int

MaterialTransparencyPercent[int]

Get transparency %, in range of 0 - 100

int MaterialTransparencyPercent[int Index] { get; }

Parameters

Index int

Property Value

int

NormalCount

Get Normal Count.

int NormalCount { get; }

Property Value

int

PatchCount

Get Patch Count.

int PatchCount { get; }

Property Value

int

PatchM[int, int]

Get M for patch at vertex index.

double PatchM[int patch, int Index] { get; }

Parameters

patch int
Index int

Property Value

double

PatchMaterialIndex[int]

Get patch material index.

int PatchMaterialIndex[int patch] { get; }

Parameters

patch int

Property Value

int

PatchPriority[int]

Get patch priority.

int PatchPriority[int patch] { get; }

Parameters

patch int

Property Value

int

Remarks

When overlapping patches are defined within the same multipatch, patch priorities can be used to explicitly specify the order in which patches should be drawn when rendered. The larger the number assigned, the higher the patch priority or precedence the patch takes when rendered.

PatchTextureVertex[int, int]

Get Texture WKSPoint for a patch at vertex index.

WKSPoint PatchTextureVertex[int patch, int Index] { get; }

Parameters

patch int
Index int

Property Value

WKSPoint

PatchTextureVertexCount[int]

Get texture vertex count for a patch.

int PatchTextureVertexCount[int patch] { get; }

Parameters

patch int

Property Value

int

Remarks

The index specified refers to the index within the list of texture vertices. This is different than the index used to specify geometry vertices.

PatchType[int]

Get patch type.

esriPatchType PatchType[int patch] { get; }

Parameters

patch int

Property Value

esriPatchType

PatchVertex[int, int]

Get Point for patch at vertex index.

WKSPointZ PatchVertex[int patch, int Index] { get; }

Parameters

patch int
Index int

Property Value

WKSPointZ

PatchVertexCount[int]

Get count of vertices in patch.

int PatchVertexCount[int patch] { get; }

Parameters

patch int

Property Value

int

Remarks

The index specified refers to the index within the list of geometry vertices. This is different than the index used to specify texture vertices.

PatchVertexID[int, int]

Get vertex Id for a patch at vertex index.

int PatchVertexID[int patch, int Index] { get; }

Parameters

patch int
Index int

Property Value

int

TextureVertexCount

Get Texture Vertex Count.

int TextureVertexCount { get; }

Property Value

int

VertexCount

Get Vertex Count.

int VertexCount { get; }

Property Value

int

Methods

QueryPatchNormal(int, int, IVector3D)

Copies the Normal for patch at specified vertex index into the input vector.

void QueryPatchNormal(int patch, int Index, IVector3D pNormal)

Parameters

patch int
Index int
pNormal IVector3D

Remarks

A Vector3D object must be instantiated before being passed as the normal parameter to this method.