private void vector3D3Button_Click(object sender, EventArgs e) { IGeometry geometry = Vector3DExamples.GetExample3(); DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry); DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry); axSceneControl.SceneGraph.RefreshViewers(); }
public static IGeometry GetExample1() { const double XOffset = 7.5; const double YOffset = 7.5; const double ZOffset = -10; //Transform3D: Cylinder Repositioned Via Move3D() IGeometry geometry = Vector3DExamples.GetExample3(); ITransform3D transform3D = geometry as ITransform3D; transform3D.Move3D(XOffset, YOffset, ZOffset); return(geometry); }
public static IGeometry GetExample2() { const double XScale = 2; const double YScale = 2; const double ZScale = 3; //Transform3D: Cylinder Scaled Via Scale3D() IGeometry geometry = Vector3DExamples.GetExample3(); //Define Origin At Which Scale Operation Should Be Performed IPoint originPoint = GeometryUtilities.ConstructPoint3D(0, 0, 0); ITransform3D transform3D = geometry as ITransform3D; transform3D.Scale3D(originPoint, XScale, YScale, ZScale); return(geometry); }
public static IGeometry GetExample3() { const double DegreesOfRotation = 45; //Transform3D: Cylinder Rotated Around An Axis Via RotateVector3D() IGeometry geometry = Vector3DExamples.GetExample3(); //Construct A Vector3D Corresponding To The Desired Axis Of Rotation IVector3D axisOfRotationVector3D = GeometryUtilities.ConstructVector3D(0, 10, 0); //Obtain Angle Of Rotation In Radians double angleOfRotationInRadians = GeometryUtilities.GetRadians(DegreesOfRotation); ITransform3D transform3D = geometry as ITransform3D; transform3D.RotateVector3D(axisOfRotationVector3D, angleOfRotationInRadians); return(geometry); }
public static IGeometry GetExample4() { const double XScale = 0.5; const double YScale = 0.5; const double ZScale = 2; const double XOffset = -5; const double YOffset = -5; const double ZOffset = -8; const double DegreesOfRotation = 90; //Transform3D: Cylinder Scaled, Rotated, Repositioned Via Move3D(), Scale3D(), RotateVector3D() IGeometry geometry = Vector3DExamples.GetExample3(); ITransform3D transform3D = geometry as ITransform3D; //Stretch The Cylinder So It Looks Like A Tube IPoint originPoint = GeometryUtilities.ConstructPoint3D(0, 0, 0); transform3D.Scale3D(originPoint, XScale, YScale, ZScale); //Rotate The Cylinder So It Lies On Its Side IVector3D axisOfRotationVector3D = GeometryUtilities.ConstructVector3D(0, 10, 0); double angleOfRotationInRadians = GeometryUtilities.GetRadians(DegreesOfRotation); transform3D.RotateVector3D(axisOfRotationVector3D, angleOfRotationInRadians); //Reposition The Cylinder So It Is Located Underground transform3D.Move3D(XOffset, YOffset, ZOffset); return(geometry); }
public static IGeometry GetExample1() { //Composite: Multiple, Disjoint Geometries Contained Within A Single MultiPatch IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IMultiPatch multiPatch = multiPatchGeometryCollection as IMultiPatch; //Vector3D Example 2 IGeometry vector3DExample2Geometry = Vector3DExamples.GetExample2(); ITransform3D vector3DExample2Transform3D = vector3DExample2Geometry as ITransform3D; vector3DExample2Transform3D.Move3D(5, 5, 0); IGeometryCollection vector3DExample2GeometryCollection = vector3DExample2Geometry as IGeometryCollection; for (int i = 0; i < vector3DExample2GeometryCollection.GeometryCount; i++) { multiPatchGeometryCollection.AddGeometry(vector3DExample2GeometryCollection.get_Geometry(i), ref _missing, ref _missing); } //Vector3D Example 3 IGeometry vector3DExample3Geometry = Vector3DExamples.GetExample3(); ITransform3D vector3DExample3Transform3D = vector3DExample3Geometry as ITransform3D; vector3DExample3Transform3D.Move3D(5, -5, 0); IGeometryCollection vector3DExample3GeometryCollection = vector3DExample3Geometry as IGeometryCollection; for (int i = 0; i < vector3DExample3GeometryCollection.GeometryCount; i++) { multiPatchGeometryCollection.AddGeometry(vector3DExample3GeometryCollection.get_Geometry(i), ref _missing, ref _missing); } //Vector3D Example 4 IGeometry vector3DExample4Geometry = Vector3DExamples.GetExample4(); ITransform3D vector3DExample4Transform3D = vector3DExample4Geometry as ITransform3D; vector3DExample4Transform3D.Move3D(-5, -5, 0); IGeometryCollection vector3DExample4GeometryCollection = vector3DExample4Geometry as IGeometryCollection; for (int i = 0; i < vector3DExample4GeometryCollection.GeometryCount; i++) { multiPatchGeometryCollection.AddGeometry(vector3DExample4GeometryCollection.get_Geometry(i), ref _missing, ref _missing); } //Vector3D Example 5 IGeometry vector3DExample5Geometry = Vector3DExamples.GetExample5(); ITransform3D vector3DExample5Transform3D = vector3DExample5Geometry as ITransform3D; vector3DExample5Transform3D.Move3D(-5, 5, 0); IGeometryCollection vector3DExample5GeometryCollection = vector3DExample5Geometry as IGeometryCollection; for (int i = 0; i < vector3DExample5GeometryCollection.GeometryCount; i++) { multiPatchGeometryCollection.AddGeometry(vector3DExample5GeometryCollection.get_Geometry(i), ref _missing, ref _missing); } return(multiPatchGeometryCollection as IGeometry); }