IRectangularTrimmedSurface_DG Interface
- GetTrimRange
- SetTrimRange
- GetTrim
- SetTrim
- GetSurface
- SetSurface
The interface represents a surface which is a part of another basis surface defined by a rectangular subset of its parameters.
IRectangularTrimmedSurface_DG can be obtained by quering from IUVSurface_DG.
Example (C++):
// Returns either length or -1
double GetAxisIfTheSurfaceIsCylindricalTrimmed(IUVSurface_DG* surfaceUV, LineDg& axis)
{
ESurfaceType_DG type = eSurfTypeUnknown;
surfaceUV->GetSurfaceType(&type);
if (type == eSurfTypeRectangularTrimmed)
{
IRectangularTrimmedSurface_DG* trimmedSurf = nullptr;
surfaceUV->QueryInterface(__uuidof(IRectangularTrimmedSurface_DG), (void**)&trimmedSurf);
IUVSurface_DG* uvSurfBasis = nullptr;
trimmedSurf->GetSurface(&uvSurfBasis);
ESurfaceType_DG typeBase = eSurfTypeUnknown;
uvSurfBasis->GetSurfaceType(&typeBase);
if (typeBase == eSurfTypeCylinder)
{
ICylinder_DG* cylind = nullptr;
uvSurfBasis->QueryInterface(__uuidof(ICylinder_DG), (void**)&cylind);
IFrame_DG* frame = nullptr;
cylind->GetLocation(&frame);
frame->GetAxisRay(2, &axis);
double min, max;
trimmedSurf->GetTrimRange(VARIANT_FALSE, &min, &max);
return max - min;
}
}
return -1.0;
}
A new object implementing IRectangularTrimmedSurface_DG can be constructed as (example):
IObjectGenerator_DGPtr gen; // Query from IModel_DG
ICylinder_DGPtr iCylinder;
gen->Create(__uuidof(ICylinder_DG), &iCylinder);
IUVSurface_DGPtr iSurfBasis;
iCylinder->QueryInterface(__uuidof(IUVSurface_DG), (void**)&iSurfBasis);
IRectangularTrimmedSurface_DGPtr iSurfTrimmed;
gen->Create1(__uuidof(IRectangularTrimmedSurface_DG), iSurfBasis, &iSurfTrimmed);
Or:
IObjectGenerator_DGPtr gen; // Query from IModel_DG
ICylinder_DGPtr iCylinder;
gen->Create(__uuidof(ICylinder_DG), &iCylinder);
IUVSurface_DGPtr iSurfBasis;
iCylinder->QueryInterface(__uuidof(IUVSurface_DG), (void**)&iSurfBasis);
double uMin, uMax, vMin, vMax;
iSurfBasis->GetParameterRange(true, &uMin, &uMax);
iSurfBasis->GetParameterRange(false, &vMin, &vMax);
IDictionary_DGPtr context;
gen->Create(__uuidof(IDictionary_DG), &context);
context->SetInterface("Basis", iSurfBasis);
context->SetDouble("uMin", uMin);
context->SetDouble("uMax", uMax);
context->SetDouble("vMin", vMin);
context->SetDouble("vMax", vMax);
IRectangularTrimmedSurface_DGPtr iSurfTrimmed;
gen->Create1(__uuidof(IRectangularTrimmedSurface_DG), context, &iSurfTrimmed);
Implements also: IGeometricObject_DG, IObject_DG.
void GetTrimRange(bool u, double *min, double *max)
void SetTrimRange(bool u, double min, double max)
Rectangle_DG GetTrim(bool u)
void SetTrim(bool u, Rectangle_DG ranges)
IUVSurface_DG GetSurface()
Returns the basis surface.
void SetSurface(IUVSurface_DG surface)
Assigns the basis surface.
|