BCGControlBar Pro for MFC

Detailed Description

The CBCGPChartDiagram3D class manages transformations and states for 3D scenes. Currently an instance of this class is automatically created by CBCGPChartVisualObject and can be retrieved with CBCGPChartVisualObject::GetDiagram3D.

You can set the following parameters for a 3D scene:

  • X rotation - the angle between X axis and vertical axis in range [0 - 360] degrees (SetPosition()).
  • Y rotation - the angle between Y axis and horizontal plane in range [-90 - 90] degrees (SetPosition()).
  • Perspective percent - a double value in range [0 - 1] (SetPosition())
  • Depth scale - a double value in range [0.1 - 10] (SetDepthScalePercent()).
  • Height scale - a double value in range [0.1 - 10] (SetHeightScalePercent()).
  • Front distance - a double value in range [0 - 0.9], which defines a placement of chart object within Z unit (SetFrontDistancePercent()).
  • Proportional scale flag - a boolean value that defines how the normalized 1x1x1 cube is scaled to fit the view (SetProportionalScale()).

Scene objects should be defined in normalized coordinates in range [-1, 1]. Call TransformPoint() to convert normalized coordinates to screen coordinates. It takes into account scene rotation, perspective and view size.

You can switch between software and hardware-accelerated rendering engines (OpenGL) at the runtime by calling SetRenderingType() or SetEngine3D() (call the later is for custom rendering engines).

See also
CBCGPEngine3D, CBCGPEngine3DOpenGL

Public Types

enum  DrawWallOptions
enum  ExplicitGrouping

Public Member Functions

 AdjustLayoutCalled to adjust layout or 3D diagram area.
 EnableRotationByMouseEnables or disables chart rotation by mouse.
 GetBaseDepthPercentReturns base depth percent for the current chart type.
 GetDepthScalePercentReturns depth scale percent.
 GetDiagramRectReturns bounding rectangle of diagram.
 GetDrawWallOptionsReturns the current wall drawing options.
 GetEngine3DReturns a pointer to 3D rendering engine.
 GetExplicitGroupingReturns the current explicit grouping option.
 GetFrontDistancePercentReturns front distance percent.
 GetHeightScalePercentReturns height scale percent.
 GetMouseRationFlagsGets mouse ration flags.
 GetPerspectivePercentReturns current perspective percent.
 GetScrollOffsetReturns the current scroll offset.
 GetXRotationReturns X rotation, in degrees.
 GetYRotationReturns Y rotation, in degrees.
 GetZoomFactorReturns the current zoom factor.
 GetZRotationReturns Z rotation.
 IsCalculateNormalsTells whether calculation of normals is enabled.
 IsRotationByMouseEnabledTells whether chart rotation by mouse is enabled.
 IsShowBackfacesTells whether a diagram shows shape backfaces.
 IsThickWallsAndFloorSpecifies whether a 3D chart displays thick walls and floor.
 IsWallIgnoreRotationTells whether the walls are repositioned when the scene rotation is changed.
 OnBegin3DDrawCalled when 3D rendering is started.
 OnDrawCalled by the chart to draw the floor and walls.
 OnDrawFloorCalled to draw the floor.
 OnDrawWallsCalled to draw the floor.
 OnEnd3DDrawCalled when 3D rendering is finished.
 ResetResets current position and perspective to default values.
 ScalePointConverts a point from normalized to screen coordinates.
 SetBaseDepthPercentThis is an internal class method.
 SetCalculateNormalsSpecifies whether polygon normals should be calculated during rendering.
 SetDepthScalePercentSets depth scale percent.
 SetDrawWallOptionsSets the floor and wall drawing options.
 SetEngine3DAllows to set a custom rendering engine.
 SetExplicitGroupingCall this method to set the current explicit grouping option. The "explicit grouping" forces a 3D chart to show series on Z axis as grouped (maximum Z coordinate is always 1) or non-grouped (Z coordinate is set to the number of series, e.g. each series has its own Z coordinate).
 SetFrontDistancePercentSets front distance.
 SetHeightScalePercentSets height scale percent.
 SetPositionSets diagram rotation and perspective.
 SetProportionalScaleDefines scaling type or 3D scene.
 SetRenderingTypeSets rendering type for 3D scene.
 SetScrollOffsetSets scroll offset of rendered scene.
 SetShowBackfacesIncludes or excludes back-faces to/from 3D scene.
 SetThickWallsAndFloorSets an option to display thick or thin walls and floor.
 SetWallsIgnoreRotationIgnores reposition of walls when the scene is rotated.
 SetZoomFactorZooms the scene in or out.
 SetZRotationSet Z rotation.
 StripWallsAndAxesHides or shows walls and vertical axes.
 TransformPointTransforms point in normalized 3D coordinates.
 TranslateDistanceConverts X and Y values in screen coordinates to normalized coordinates.

Public Attributes

 m_formatWallsContains walls and floor formatting options.