STK ObjectsSend comments on this topic.
IAgVOModelTransCollection Interface

Description

IAgVOModelTransCollection Interface. A collection of available transformations in the model.

Public Properties

Public Property CountReturns a number of elements in the collection.
Public Property ItemReturns a model transformation by name or at a specified position.
Public Property NameName of the Model Transformation.

Example

Configure 3D model articulations
[C#]
// Configure articulation
IAgVOModelArtic modelArticulation = model.Articulation;
modelArticulation.EnableDefaultSave = false;
modelArticulation.SaveArticFileOnSave = true;

// Set our articulation and transformations
// For this sample, these articulations exist for a default satellite model
int levelOfDetail = 0;
string articulation = "Satellite";
string transformation = "Size";


// Get the current transition value
double currentTransVal = modelArticulation.GetTransValue(levelOfDetail, articulation, transformation);

// Change the value
double newTransVal = currentTransVal * 0.50;

// Set our new transition value
modelArticulation.SetTransValue(levelOfDetail, articulation, transformation, newTransVal);
List all 3D model articulations
[C#]
// Enumerating through the transformation collection is helpful if you do not
// know what tranformations exist or their value ranges

IAgVOModelArtic modelArticulation = model.Articulation;

for (int lod = 0; lod < modelArticulation.LODCount; lod++)
{
    // Get all articulations
    // GetAvailableArticulations returns a one dimensional array of articulation names
    Array articulations = modelArticulation.GetAvailableArticulations(lod);

    // Enumerate through available articulations
    for (int articulation = 0; articulation < articulations.Length; articulation++)
    {
        // We need the articulation string to call the GetAvailableTransformations function
        String articulationString = articulations.GetValue(articulation) as String;

        // Get all transformations
        IAgVOModelTransCollection transformations = modelArticulation.GetAvailableTransformations(lod, articulationString);

        // Enumerate through available transformations
        foreach (IAgVOModelTrans trans in transformations)
        {
            Console.WriteLine("Name: {0}, Current {1}, Max {2}, Min {3}", trans.Name, trans.Value, trans.Max, trans.Min);
        }
    }
}
Configure 3D model articulations
[Visual Basic .NET]
' Configure articulation
Dim modelArticulation As IAgVOModelArtic = model.Articulation
modelArticulation.EnableDefaultSave = False
modelArticulation.SaveArticFileOnSave = True

' Set our articulation and transformations
' For this sample, these articulations exist for a default satellite model
Dim levelOfDetail As Integer = 0
Dim articulation As String = "Satellite"
Dim transformation As String = "Size"


' Get the current transition value
Dim currentTransVal As Double = modelArticulation.GetTransValue(levelOfDetail, articulation, transformation)

' Change the value
Dim newTransVal As Double = currentTransVal * 0.5

' Set our new transition value
modelArticulation.SetTransValue(levelOfDetail, articulation, transformation, newTransVal)
List all 3D model articulations
[Visual Basic .NET]
' Enumerating through the transformation collection is helpful if you do not
' know what tranformations exist or their value ranges

Dim modelArticulation As IAgVOModelArtic = model.Articulation

Dim lod As Integer = 0
While lod < modelArticulation.LODCount
	' Get all articulations
	' GetAvailableArticulations returns a one dimensional array of articulation names
	Dim articulations As Array = modelArticulation.GetAvailableArticulations(lod)

	' Enumerate through available articulations
	Dim articulation As Integer = 0
	While articulation < articulations.Length
		' We need the articulation string to call the GetAvailableTransformations function
		Dim articulationString As [String] = TryCast(articulations.GetValue(articulation), [String])

		' Get all transformations
		Dim transformations As IAgVOModelTransCollection = modelArticulation.GetAvailableTransformations(lod, articulationString)

		' Enumerate through available transformations
		For Each trans As IAgVOModelTrans In transformations
			Console.WriteLine("Name: {0}, Current {1}, Max {2}, Min {3}", trans.Name, trans.Value, trans.Max, trans.Min)
		Next
		System.Math.Max(System.Threading.Interlocked.Increment(articulation),articulation - 1)
	End While
	System.Math.Max(System.Threading.Interlocked.Increment(lod),lod - 1)
End While
© 2024 Analytical Graphics, Inc. All Rights Reserved.