#include <c4d_basedraw.h>
Represents a view window that can be drawn into.
Static Public Member Functions | |
static Int32 | GetColorSpaceFromDocumentIndex () |
Static Public Member Functions inherited from BaseList2D | |
static BaseList2D * | Alloc (Int32 type) |
static void | Free (BaseList2D *&bl) |
Private Member Functions | |
BaseDraw () | |
~BaseDraw () | |
BaseContainer | GetData (void) |
void | SetData (const BaseContainer &bc, Bool add=true) |
BaseContainer * | GetDataInstance (void) |
Get Parameter | |
GeData | GetParameterData (Int32 id) |
Camera | |
Bool | HasCameraLink (void) |
BaseObject * | GetSceneCamera (const BaseDocument *doc) |
void | SetSceneCamera (BaseObject *op, Bool animate=false) |
BaseObject * | GetEnvironmentObject () const |
BaseObject * | GetSkyObject () const |
BaseObject * | GetBackgroundObject () const |
BaseObject * | GetForegroundObject () const |
BaseObject * | GetEditorCamera (void) |
const AtomArray & | GetXRefObjects () const |
Initialization | |
void | InitClipbox (Int32 left, Int32 top, Int32 right, Int32 bottom, Int32 flags) |
void | InitView (BaseContainer *camera, const Matrix &op_m, Float sv, Float pix_x, Float pix_y, Bool fitview) |
void | InitializeView (BaseDocument *doc, BaseObject *cam, Bool editorsv) |
void | InitLegacyDrawport () |
void | DrawEnd () |
static void | PrepareActionSelections (const BaseDocument *doc, Bool withChildren) |
Color/Transparency | |
Vector | GetObjectColor (const BaseDrawHelp *bh, BaseObject *op, Bool lines=false, Bool usedInBaseDraw=true, Int instanceIndex=0) const |
Vector | CheckColor (const Vector &col) |
void | SetTransparency (Int32 trans) |
Int32 | GetTransparency (void) const |
Drawing Setup | |
void | SetPen (const Vector &col, Int32 flags=0) |
void | SetPointSize (Float pointsize) |
Float | GetHandleSize (DRAWHANDLE type) const |
void | SetLightList (Int32 mode) |
Color Conversion | |
Vector | ConvertColor (const Vector &c) |
Vector | ConvertColorReverse (const Vector &c) |
Z-Buffer/Depth Setup | |
void | LineZOffset (Int32 offset) |
void | SetDepth (Bool enable) |
Matrix Transform | |
void | SetMatrix_Projection () |
void | SetMatrix_Screen () |
void | SetMatrix_Screen (Int32 zoffset) |
void | SetMatrix_Screen (Int32 zoffset, const Matrix4d *m) |
void | SetMatrix_Camera () |
void | SetMatrix_Matrix (BaseObject *op, const Matrix &mg) |
void | SetMatrix_Matrix (BaseObject *op, const Matrix &mg, Int32 zoffset) |
2D Drawing | |
void | DrawPoint2D (const Vector &p) |
void | DrawLine2D (const Vector &p1, const Vector &p2) |
void | DrawHandle2D (const Vector &p, DRAWHANDLE type=DRAWHANDLE::SMALL) |
void | DrawCircle2D (Int32 mx, Int32 my, Float rad) |
void | DrawHUDText (Int32 x, Int32 y, const maxon::String &txt) |
void | DrawMultipleHUDText (const maxon::BaseArray< HUDTextEntry > &texts) |
void | SetRedrawHelper (const maxon::DrawportRedrawHelperRef &redrawHelper) |
const maxon::DrawportRedrawHelperRef & | GetRedrawHelper () const |
const maxon::BaseArray< EditorLight > & | GetEditorLights () const |
3D Drawing | |
void | DrawHandle (const Vector &vp, DRAWHANDLE type, Int32 flags) |
void | DrawHandleWorld (const Vector &vp, const Vector &col, DRAWHANDLE type) |
void | DrawPointArray (Int32 cnt, const Vector32 *vp, const Float32 *vc=nullptr, Int32 colcnt=0, const Vector32 *vn=nullptr) |
void | DrawLine (const Vector &p1, const Vector &p2, Int32 flags) |
void | DrawArc (const Vector &pos, Float radius, Float angle_start, Float angle_end, Int32 subdiv=32, Int32 flags=0) |
void | DrawPoly (const Vector *vp, const Vector *vf, const Vector *vn, Int32 anz, Int32 flags) |
void | DrawTexture (const BaseBitmap *bmp, const Vector *padr4, const Vector *cadr, const Vector *vnadr, const Vector *uvadr, Int32 pntcnt, DRAW_ALPHA alphamode, DRAW_TEXTUREFLAGS flags) |
void | DrawCircle (const Matrix &m) |
void | DrawBox (const Matrix &m, Float size, const Vector &col, Bool wire) |
void | DrawBoundingBox (BaseObject *op, const Matrix &mg, BaseDrawHelp *bh, Bool shading, Vector *colorOverride=nullptr) |
void | DrawPolygon (const Vector *p, const Vector *f, Bool quad) |
void | DrawSphere (const Vector &off, const Vector &size, const Vector &col, Int32 flags) |
void | DrawArrayEnd () |
Object Drawing | |
DRAWRESULT | DrawPolygonObject (BaseDrawHelp *bh, BaseObject *op, DRAWOBJECT flags, BaseObject *parent=nullptr, const Vector &col=Vector(.5)) |
DRAWRESULT | DrawObject (BaseDrawHelp *bh, BaseObject *op, DRAWOBJECT flags, DRAWPASS drawpass, BaseObject *parent=nullptr, const Vector &col=Vector(.5)) |
void | DrawAnimationPath (BaseDocument *doc, BaseObject *op, const Matrix &upmg, Bool showActivation, Bool global, DRAWPASS drawpass, const BaseDrawHelp *bh) |
void | DrawBoxEdges (BaseDocument *doc, BaseObject *op, const Matrix &mg, Bool inversez, Bool inherit, Int32 vis, Bool child) |
Bool | DrawHighlight (BASEDRAW_HIGHLIGHT flags) |
Bool | DrawPostPass () |
Bool | DrawSceneHook (BaseDocument *doc, BaseDrawHelp *bh, BaseThread *bt, SCENEHOOKDRAW flags, Int32 start=LIMIT< Int32 >::MAX, Int32 end=LIMIT< Int32 >::MIN) |
Line Strip Drawing | |
void | LineStripBegin () |
void | LineStripEnd () |
void | LineStrip (const Vector &vp, const Vector &vc, Int32 flags) |
Polyline Drawing | |
Bool | InitDrawXORPolyLine () |
void | FreeDrawXORPolyLine () |
void | DrawXORPolyLine (const Float32 *p, Int32 cnt) |
void | BeginDrawXORPolyLine () |
void | EndDrawXORPolyLine (Bool blit) |
Highlight Pass | |
Bool | GetHighlightPassColor (const BaseDrawHelp &bh, Bool lineObject, Vector &col) const |
View Undo | |
void | InitUndo (BaseDocument *doc) |
void | DoUndo (BaseDocument *doc) |
Draw Parameters | |
void | SetDrawParam (Int32 id, const GeData &data) |
GeData | GetDrawParam (Int32 id) const |
Extended GL Mode | |
Bool | IsOpenGL () const |
Bool | IsEnhancedOpenGL () const |
Int32 | GetFrameScreen (Int32 *cl, Int32 *ct, Int32 *cr, Int32 *cb) |
GPU Renderer | |
Bool | IsMarkedAsGPURenderer () |
Bool | IsGPURenderer () |
Bool | IsMarkedAsCPURenderer () |
Bool | IsCPURenderer () |
void | SetViewportRender (const maxon::Id &draw, const maxon::Id &pick) |
void | FrameFinished () |
void | GetViewportRender (maxon::ViewportRenderRef &viewportRender, Bool draw) const |
Alloc/Free | |
static BaseDraw * | Alloc () |
static void | Free (BaseDraw *&bd) |
Additional Inherited Members | |
Static Public Attributes inherited from BaseList2D | |
static const Int32 | SETBIT_FLAG_NODIRTY |
static const Int32 | SETBIT_FLAG_REMOVE |
|
private |
|
private |
|
private |
Internal.
|
private |
Internal.
|
private |
Internal.
Convenience method to get parameters.
Here is his simple implementation:
[in] | id | A parameter ID. See dbasedraw.h description file. |
|
static |
Allocates a base draw. Destroy the allocated base draw with Free(). Use AutoAlloc to automate the allocation and destruction based on scope. Private.
|
static |
Bool HasCameraLink | ( | void | ) |
Checks if the camera link is enabled.
BaseObject* GetSceneCamera | ( | const BaseDocument * | doc | ) |
Gets the current scene camera from the passed document.
[in] | doc | The document to get the scene camera from. The caller owns the pointed document. |
void SetSceneCamera | ( | BaseObject * | op, |
Bool | animate = false |
||
) |
Sets a new scene camera. If op is nullptr, the editor camera is used.
[in] | op | The new camera. |
[in] | animate | Private. |
BaseObject* GetEnvironmentObject | ( | ) | const |
Gets the environment object, which is at the highest position in the scene hierarchy, visible and enabled.
BaseObject* GetSkyObject | ( | ) | const |
Gets the sky object, which is at the highest position in the scene hierarchy, visible and enabled.
BaseObject* GetBackgroundObject | ( | ) | const |
Gets the background object, which is at the highest position in the scene hierarchy, visible and enabled.
BaseObject* GetForegroundObject | ( | ) | const |
Gets the foreground object, which is at the highest position in the scene hierarchy, visible and enabled.
BaseObject* GetEditorCamera | ( | void | ) |
Gets the editor camera.
const AtomArray& GetXRefObjects | ( | ) | const |
Gets all X-Ref objects.
Used to render into a frame buffer with a different resolution than the editor view. Private.
[in] | left | The left coordinate of the frame buffer. |
[in] | top | The top coordinate of the frame buffer. |
[in] | right | The right coordinate of the frame buffer. |
[in] | bottom | The bottom coordinate of the frame buffer. |
[in] | flags | The flag INIT_CLIPBOX_ADJUSTGLSIZE can be set. |
void InitView | ( | BaseContainer * | camera, |
const Matrix & | op_m, | ||
Float | sv, | ||
Float | pix_x, | ||
Float | pix_y, | ||
Bool | fitview | ||
) |
Used to render into a frame buffer with a different resolution than the editor view. Private.
[in] | camera | The camera's container. The caller owns the pointed container. |
[in] | op_m | The camera's matrix. |
[in] | sv | The frame's ratio. |
[in] | pix_x | The frame's X size. |
[in] | pix_y | The frame's Y size. |
[in] | fitview | Set to true to fit the view. |
void InitializeView | ( | BaseDocument * | doc, |
BaseObject * | cam, | ||
Bool | editorsv | ||
) |
Used after rendering into a frame buffer with a different resolution than the editor view. Private.
[in] | doc | The view's document. The caller owns the pointed document. |
[in] | cam | The view's camera. The caller owns the pointed camera. |
[in] | editorsv | Set to true to retain the view's ratio. |
void InitLegacyDrawport | ( | ) |
Must be called from an external renderer to make use of the BaseDraw (e.g. for drawing helper lines).
void DrawEnd | ( | ) |
Private.
|
static |
Private. Prepares the selected objects for rendering (i.e. sets the BIT_ACTIVESELECTIONDRAW bit).
Vector GetObjectColor | ( | const BaseDrawHelp * | bh, |
BaseObject * | op, | ||
Bool | lines = false , |
||
Bool | usedInBaseDraw = true , |
||
Int | instanceIndex = 0 |
||
) | const |
Gets the wireframe color in the editor for the specified object.
Some types of objects have certain colors. For polygon objects the main color is taken into account.
[in] | bh | The base draw helper.The caller owns the pointed base draw helper. |
[in] | op | The object to get the wireframe color. The caller owns the pointed object. |
[in] | lines | If set to true and the object's color is set to Layer but the object is not assigned to a layer the color set for Shaded Wireframe is used. |
Makes sure that a color has at least 15% difference to the background color.
[in] | col | The original color. |
void SetTransparency | ( | Int32 | trans | ) |
Sets the transparency value for the following polygons drawing. The range is 0 to 255, where 255 is 100% transparent.
Use negative values for true transparencies and positive values for 'dotted' transparencies.
[in] | trans | The transparency. |
Int32 GetTransparency | ( | void | ) | const |
Gets the current transparency value for polygons drawing. The range is 0 to 255, where 255 is 100% transparent.
Negative values are true transparencies and positive values are 'dotted' transparencies.
Sets the pen color for the following drawing operations.
[in] | col | The new pen color. |
[in] | flags | Flag SET_PEN_USE_PROFILE_COLOR can be set. |
void SetPointSize | ( | Float | pointsize | ) |
Sets the drawn point size.
[in] | pointsize | The new point size. |
Float GetHandleSize | ( | DRAWHANDLE | type | ) | const |
Gets the point size in pixels for a DRAWHANDLE
size.
[in] | type | Handle type. |
void SetLightList | ( | Int32 | mode | ) |
Sets the lighting used by the draw functions.
[in] | mode | The lighting mode: BDRAW_SETLIGHTLIST |
Converts colors from document color to viewport color profile.
[in] | c | The color to convert (document). |
Converts colors from viewport color to document color profile.
[in] | c | The color to convert (viewport). |
void LineZOffset | ( | Int32 | offset | ) |
Sets the current Z buffer offset. Use this to for example draw lines over shaded polygons in front of the screen.
A higher offset value means a higher draw priority in the Z-buffer. For example:
[in] | offset | The new Z-buffer offset. |
void SetDepth | ( | Bool | enable | ) |
Enables/disables writing to the depth buffer. Private.
[in] | enable | true if the depth buffer should be enabled for writing, otherwise false. |
void SetMatrix_Projection | ( | ) |
Internal.
void SetMatrix_Screen | ( | ) |
Sets the transformation matrix to screen coordinates, i.e. from (0, 0) to (width, height).
void SetMatrix_Screen | ( | Int32 | zoffset | ) |
Sets the transformation matrix to screen coordinates, i.e. from (0, 0) to (width, height).
[in] | zoffset | Sets the current Z buffer offset. Use this to for example draw lines over shaded polygons in front of the screen. A higher zoffset value means a higher draw priority in the Z buffer. For example:
|
void SetMatrix_Camera | ( | ) |
Sets the transformation matrix to the camera system.
void SetMatrix_Matrix | ( | BaseObject * | op, |
const Matrix & | mg | ||
) |
Sets the transformation matrix to the given matrix mg.
The transformation matrix should transform coordinates passed to the draw functions into world coordinates.
For example for an object generator with local handle vectors the global matrix, or even better the matrix returned by BaseDrawHelp::GetMg(), should be used.
In case of a particle system, which calculates all its particles in global space, a unit matrix can be passed because the vectors are already in global space. Basically the matrix that transforms the vectors into global space should be passed.
[in] | op | A scene object or nullptr. If an object pointer is passed this is used to compare with an internal pointer to the last passed object pointer. If the pointers differ no matrix comparison is required internally. Used for performance reasons. The caller owns the pointed object. |
[in] | mg | The new transformation matrix. |
void SetMatrix_Matrix | ( | BaseObject * | op, |
const Matrix & | mg, | ||
Int32 | zoffset | ||
) |
Sets the transformation matrix to the given matrix mg.
The transformation matrix should transform coordinates passed to the draw functions into world coordinates.
For example for an object generator with local handle vectors the global matrix, or even better the matrix returned by BaseDrawHelp::GetMg(), should be used.
In case of a particle system, which calculates all its particles in global space, a unit matrix can be passed because the vectors are already in global space. Basically the matrix that transforms the vectors into global space should be passed.
[in] | op | A scene object or nullptr. If an object pointer is passed this is used to compare with an internal pointer to the last passed object pointer. If the pointers differ no matrix comparison is required internally. Used for performance reasons. The caller owns the pointed object. |
[in] | mg | The new transformation matrix. |
[in] | zoffset | Sets the current Z buffer offset. Use this to for example draw lines over shaded polygons in front of the screen. A higher zoffset value means a higher draw priority in the Z buffer. For example:
|
void DrawPoint2D | ( | const Vector & | p | ) |
Draws a one-pixel point in the current pen color at p.
[in] | p | A point in screen space coordinate. |
Draws a line in the current pen color between p1 and p2.
[in] | p1 | The start point of the line in screen space coordinate. |
[in] | p2 | The end point of the line in screen space coordinate. |
void DrawHandle2D | ( | const Vector & | p, |
DRAWHANDLE | type = DRAWHANDLE::SMALL |
||
) |
Draws a handle at p.
[in] | p | A point in screen space coordinate. |
[in] | type | The handle type: DRAWHANDLE |
Draws a circle in the current pen color with a radius of rad and the center at (mx, my).
[in] | mx | The X coordinate of the circle's center in screen space coordinate. |
[in] | my | The Y coordinate of the circle's center in screen space coordinate. |
[in] | rad | The circle's radius. |
void DrawHandle | ( | const Vector & | vp, |
DRAWHANDLE | type, | ||
Int32 | flags | ||
) |
Draws a handle at vp.
[in] | vp | A point. The coordinate must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix(). |
[in] | type | The handle type: DRAWHANDLE |
[in] | flags | The legacy drawing flags: LEGACY_DRAW_FLAGS, NOCLIP_D or NOCLIP_Z. |
void DrawHandleWorld | ( | const Vector & | vp, |
const Vector & | col, | ||
DRAWHANDLE | type | ||
) |
Draws a handle at vp.
[in] | vp | A point in world coordinate. |
[in] | col | Handle color. |
[in] | type | The handle type: DRAWHANDLE |
void DrawPointArray | ( | Int32 | cnt, |
const Vector32 * | vp, | ||
const Float32 * | vc = nullptr , |
||
Int32 | colcnt = 0 , |
||
const Vector32 * | vn = nullptr |
||
) |
Draws an array of points with individual colors.
[in] | cnt | The number of points. |
[in] | vp | An array of point coordinates. The caller owns the pointed array. |
[in] | vc | An array of point color elements. The caller owns the pointed array. |
[in] | colcnt | The number of color elements, for example 3 for RGB. |
[in] | vn | Reserved for future use. The caller owns the pointed array. |
void DrawArc | ( | const Vector & | pos, |
Float | radius, | ||
Float | angle_start, | ||
Float | angle_end, | ||
Int32 | subdiv = 32 , |
||
Int32 | flags = 0 |
||
) |
Draws an arc (section of a circle) in the current pen color at pos.
[in] | pos | The position of the rectangle that defines the arc. The coordinate must be in screen space. |
[in] | radius | The arc's radius. |
[in] | angle_start | The start of the angle in radians. |
[in] | angle_end | The end of the angle in radians. |
[in] | subdiv | The range between angle_start and angle_end is divided into subdiv line segments. |
[in] | flags | The legacy drawing flags: LEGACY_DRAW_FLAGS, NOCLIP_D or NOCLIP_Z. |
Draws a colored and shaded polygon using the points in vp, the colors in vf and the normals in vn.
Only triangles and quadrangles are accepted. The colors are interpolated between the points. The shading is determined by SetLightList().
[in] | vp | An array of point coordinates. The caller owns the pointed array. |
[in] | vf | An array of point colors. The caller owns the pointed array. |
[in] | vn | An array of point normals. The caller owns the pointed array. |
[in] | anz | The number of points. Must be either 3 (for triangles) or 4 (for quadrangles). |
[in] | flags | The legacy drawing flags: LEGACY_DRAW_FLAGS, NOCLIP_D or NOCLIP_Z. |
void DrawTexture | ( | const BaseBitmap * | bmp, |
const Vector * | padr4, | ||
const Vector * | cadr, | ||
const Vector * | vnadr, | ||
const Vector * | uvadr, | ||
Int32 | pntcnt, | ||
DRAW_ALPHA | alphamode, | ||
DRAW_TEXTUREFLAGS | flags | ||
) |
Draws a colored and shaded texture polygon using the points in padr4, the colors in cadr, the normals in vnadr and the UV coordinates in uvadr.
Only triangles and quadrangles are accepted. The colors are interpolated between the points and mutiplied with the texture color. The shading is determined by SetLightList(). The texture must live at least until the frame redraw has completed. Otherwise DRAW_TEXTUREFLAGS::TEMPORARY has to be set.
[in] | bmp | The texture to draw. The caller owns the pointed bitmap. |
[in] | padr4 | An array of point coordinates. The coordinates must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix(). |
[in] | cadr | An array of colors. Must have 4 items regardless of pntcnt. |
[in] | vnadr | An array of point normals. Must have 4 items regardless of pntcnt. |
[in] | uvadr | An array of UV coordinates. Must have 4 items regardless of pntcnt. |
[in] | pntcnt | The number of points in padr4. Must be either 3 (triangle) or 4 (quadrangle). |
[in] | alphamode | The alpha channel mode: DRAW_ALPHA |
[in] | flags | A combination of these flags: DRAW_TEXTUREFLAGS |
void DrawCircle | ( | const Matrix & | m | ) |
Draws an ellipse in the current pen color. The ellipse is specified by the matrix m, where m.v1 and m.v2 are the axis vectors and m.off is the center position. (m.v3 is not used.)
[in] | m | A matrix describing the ellipse. The coordinates must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix(). |
Draws a box. The eight points of the box are defined as:
[in] | m | A matrix describing the box. The coordinates must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix(). |
[in] | size | The size of the box. |
[in] | col | The color of the box. |
[in] | wire | If true the box is drawn as wireframe. |
void DrawBoundingBox | ( | BaseObject * | op, |
const Matrix & | mg, | ||
BaseDrawHelp * | bh, | ||
Bool | shading, | ||
Vector * | colorOverride = nullptr |
||
) |
Draws the bounding box of given BaseObject (op).
[in] | op | BaseObject used to extract the bounding box. |
[in] | mg | Global Matrix for the BoundingBox (may differ from op) |
[in] | bh | The base draw help. The caller owns the pointed base draw help.. |
[in] | shading | If true the shader is applied |
[in] | colorOverride | Use specified color. If null, object color is used. |
Draws a manually shaded triangle or quadrangle.
The corner points are given as an array of vectors in p, and the corner colors as a corresponding array of Vectors in f. If quad is false there should be 3 elements in each array, otherwise 4. The colors are interpolated between the corners.
[in] | p | An array of point coordinates. The caller owns the pointed array. The points coordinates must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix(). |
[in] | f | An array of point colors. The caller owns the pointed array. |
[in] | quad | If true the number of points must be 4, otherwise it must be 3. |
Draws a sphere at position off of size specified by the size vector in each direction and color specified by col.
[in] | off | The position of the sphere. The point coordinate must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix(). |
[in] | size | The size of the sphere. |
[in] | col | The color of the sphere. |
[in] | flags | The flags: NOCLIP_D or NOCLIP_Z and/or BDRAW_DRAW_SPHERE_FLAGS_NO_SHADING. |
void DrawArrayEnd | ( | ) |
Each DrawPolygon() puts the polygon into an internal array and draws the polygons when the array is full or an OpenGL state changes (e.g. the matrix). DrawArrayEnd() forces this operation.
DRAWRESULT DrawPolygonObject | ( | BaseDrawHelp * | bh, |
BaseObject * | op, | ||
DRAWOBJECT | flags, | ||
BaseObject * | parent = nullptr , |
||
const Vector & | col = Vector(.5) |
||
) |
Draws the polygon object op.
[in] | bh | The base draw help. The caller owns the pointed base draw help. |
[in] | op | The polygon object to draw. The caller owns the pointed object. |
[in] | flags | The flags: DRAWOBJECT |
[in] | parent | This is used for the viewport filter. Take the Floor object for example, it displays a polygon object in the viewport. If parent is set to nullptr the drawn polygon is considered by the viewport filter. If the Floor object has been passed to parent the Floor object is considered by the viewport filter instead. |
[in] | col | The object's color. |
DRAWRESULT DrawObject | ( | BaseDrawHelp * | bh, |
BaseObject * | op, | ||
DRAWOBJECT | flags, | ||
DRAWPASS | drawpass, | ||
BaseObject * | parent = nullptr , |
||
const Vector & | col = Vector(.5) |
||
) |
Draws the object op.
[in] | bh | The base draw help. The caller owns the pointed base draw help. |
[in] | op | The object to draw. The caller owns the pointed object. |
[in] | flags | The flags: DRAWOBJECT |
[in] | drawpass | The draw pass: DRAWPASS |
[in] | parent | This is used for the viewport filter. Take the Floor object for example, it displays a polygon object in the viewport. If parent is set to nullptr the drawn polygon is considered by the viewport filter. If the Floor object has been passed to parent the Floor object is considered by the viewport filter instead. |
[in] | col | The object's color. |
void DrawAnimationPath | ( | BaseDocument * | doc, |
BaseObject * | op, | ||
const Matrix & | upmg, | ||
Bool | showActivation, | ||
Bool | global, | ||
DRAWPASS | drawpass, | ||
const BaseDrawHelp * | bh | ||
) |
void DrawBoxEdges | ( | BaseDocument * | doc, |
BaseObject * | op, | ||
const Matrix & | mg, | ||
Bool | inversez, | ||
Bool | inherit, | ||
Int32 | vis, | ||
Bool | child | ||
) |
Bool DrawHighlight | ( | BASEDRAW_HIGHLIGHT | flags | ) |
Private.
Bool DrawPostPass | ( | ) |
Private.
Bool DrawSceneHook | ( | BaseDocument * | doc, |
BaseDrawHelp * | bh, | ||
BaseThread * | bt, | ||
SCENEHOOKDRAW | flags, | ||
Int32 | start = LIMIT<Int32>::MAX , |
||
Int32 | end = LIMIT<Int32>::MIN |
||
) |
Private.
void LineStripBegin | ( | ) |
Starts a new colored line strip.
Draw several line strip segments with LineStrip() calls and then finish the line strip with LineStripEnd().
void LineStripEnd | ( | ) |
Finishes line strips started with LineStripBegin().
Draws a line strip from the point vp of the last call to LineStrip() to the current vp. The line strip is colored with a gradient from the last vc to the new vc.
[in] | vp | The point coordinate. The coordinate must be in the space defined by SetMatrix_Screen(), SetMatrix_Camera() or SetMatrix_Matrix(). |
[in] | vc | The point color. |
[in] | flags | The legacy drawing flags: LEGACY_DRAW_FLAGS. |
Bool InitDrawXORPolyLine | ( | ) |
Deprecated. Initializes the view to draw XOR poly line (set the correct projection matrices).
void FreeDrawXORPolyLine | ( | ) |
Deprecated. Frees drawing XOR poly line (restore the old projection matrices).
Deprecated. Draws a XOR poly line. Example:
[in] | p | The pointer to the line points array. The format of the array is 2*cnt*sizeof(Float32) (2 Float32 per point). |
[in] | cnt | The number of line points. |
void BeginDrawXORPolyLine | ( | ) |
Deprecated. Begins drawing an XOR poly line (sets the view's context as current context).
void EndDrawXORPolyLine | ( | Bool | blit | ) |
Deprecated. Ends the drawing of a XOR poly line (makes nullptr the current context).
[in] | blit | Set to true to use blitting. |
Bool GetHighlightPassColor | ( | const BaseDrawHelp & | bh, |
Bool | lineObject, | ||
Vector & | col | ||
) | const |
Gets the color in which the object is to draw in the highlight pass.
If the object is selected or highlighted the function returns true and the color is returned in col.
[in] | bh | The base draw help. |
[in] | lineObject | Must be set to true, if the object is a line object. |
[in] | col | Assigned the highlight color. |
void InitUndo | ( | BaseDocument * | doc | ) |
Call before a change is made to the view to add the old setting to the undo buffer for the view. (This undo buffer is separate from the normal undo buffer.)
[in] | doc | The view's document. The caller owns the pointed document. |
void DoUndo | ( | BaseDocument * | doc | ) |
Performs an undo operation in the view. This is the same as the user selecting Undo View from within Cinema 4D.
[in] | doc | The view's document. The caller owns the pointed document. |
Sets draw parameters.
[in] | id | The draw parameter ID: DRAW_PARAMETER |
[in] | data | The new draw parameter data to set. |
Gets draw parameters.
[in] | id | The draw parameter ID: DRAW_PARAMETER |
void AddMessageHook | ( | BaseDrawMessageHook | fn | ) |
Adds a message hook to the base draw.
This hook is called when the user chooses 'Adapt View', changes the scene camera or if the base draw is deleted. Private.
[in] | fn | The message hook. |
Bool AddToPostPass | ( | BaseObject * | op, |
BaseDrawHelp * | bh | ||
) |
Adds the object op to DRAWPASS::XRAY::
Example:
The object in this example is drawn both in the object and X-ray pass.
[in] | op | The object to add to the X-ray pass. The caller owns the pointed object. |
[in] | bh | The base draw helper. The caller owns the pointed base draw helper. |
DISPLAYFILTER GetDisplayFilter | ( | ) | const |
Gets the current display filter.
This is a bit field derived from the BASEDRAW_DISPLAYFILTER_* description flags in dbasedraw.h. To set the display filter you have to use the description flags with SetParameter().
void SetDisplayFilter | ( | DISPLAYFILTER | displayFilter | ) |
Sets the current display filter. Private.
[in] | displayFilter | The new display filter. |
DISPLAYMODE GetReductionMode | ( | ) | const |
Gets the reduction mode of the base draw.
void SetDrawPass | ( | DRAWPASS | drawPass | ) |
Sets the current drawpass.
[in] | drawPass | The new drawpass: DRAWPASS |
Bool GetDrawStatistics | ( | maxon::DataDictionary & | statistics | ) | const |
Private. Gets drawport geometry statistics.
[out] | statistics | The container filled with the statistics: DRAW_STATISTIC |
DRAWFLAGS GetDrawFlags | ( | ) | const |
Gets the draw flags.
DISPLAYEDITSTATE GetEditState | ( | ) |
Gets the current edit state.
This is a bit field derived from the edit state description flags in dbasedraw.res. To set the display filter you have to use the description flags with SetParameter().
EditorWindow* GetEditorWindow | ( | ) |
Gets the EditorWindow for this base draw.
Gets the grid spacing and the transparency value of the minor grid that fade when the user zoom in or out with dynamic grid.
[out] | step | Is assigned the workplane grid spacing. |
[out] | fade | Is assigned the transparency value of the minor grid. |
Gets the view matrix.
[in] | n | The type of view matrix to get: DRAW_GET_VIEWMATRIX |
Transforms screen space coordinates to clip space. The screen origin is in the upper left corner, the origin of the clip space is in the lower left corner.
[in] | screenCoordinates | Coordinates in screen space. |
Bool IsViewOpen | ( | BaseDocument * | doc | ) |
Checks if a view is open. A view is open if it is anywhere in the layout, i.e. even if it is hidden as a tab or behind another window.
[in] | doc | The document for the operation. The caller owns the pointed document. |
void OverrideCamera | ( | StereoCameraInfo * | si | ) |
Changes the stereoscopic camera data for this view.
[in] | si | The stereoscopic camera data to set. The caller owns the pointed StereoCameraInfo. |
Checks if the screen point (x,y) is within a hit range of the world point p, i.e. if the screen point is close to the world points projection on the screen.
[in] | p | A point in world space. |
[in] | x | A screen X coordinate. |
[in] | y | A screen Y coordinate. |
[in] | range | Range in screen space. |
void SetClipPlaneOffset | ( | Float | o | ) |
Offsets the OpenGL clipping planes by this offset.
[in] | o | The offset. |
void SetTexture | ( | BaseBitmap * | bm, |
Bool | tile, | ||
DRAW_ALPHA | alphamode, | ||
DRAW_TEXTUREFLAGS | flags | ||
) |
Sets a texture used by the vertex buffer.
[in] | bm | The texture's bitmap. The caller owns the pointed bitmap. |
[in] | tile | Set to true to enable tiling. |
[in] | alphamode | The alpha channel mode: DRAW_ALPHA |
[in] | flags | The draw texture flags: DRAW_TEXTUREFLAGS |
DRAW_TEXTUREFLAGS GetPreferredHUDTextureFlags | ( | ) | const |
Gets the preferred texture flags for HUD drawing.
A quick shading algorithm that only takes the angle to the camera and a default light into account.
A point and a normal in world space are passed and an intensity is returned.
[in] | p | A point in world space. |
[in] | n | A normal in world space. |
Bool TestBreak | ( | ) |
Checks for thread breaks in the draw.
Bool IsOpenGL | ( | ) | const |
Extended OpenGL mode. This mode is not documented. See c4d_gl.h for definitions.
Bool IsEnhancedOpenGL | ( | ) | const |
Extended OpenGL mode. This mode is not documented. See c4d_gl.h for definitions.
Extended OpenGL mode. This mode is not documented. See c4d_gl.h for definitions.
void DrawHUDText | ( | Int32 | x, |
Int32 | y, | ||
const maxon::String & | txt | ||
) |
Draws text into the 2D viewport in the style of the HUD.
[in] | x | The left X coordinate to draw the text at. |
[in] | y | The upper Y coordinate to draw the text at. |
[in] | txt | The text to draw. |
void DrawMultipleHUDText | ( | const maxon::BaseArray< HUDTextEntry > & | texts | ) |
Draws many HUD text entries at once.
[in] | texts | The array of text entries and their screen space positions to draw to the HUD. |
void SetRedrawHelper | ( | const maxon::DrawportRedrawHelperRef & | redrawHelper | ) |
Sets the redraw helper that is used for all draw operations.
[in] | redrawHelper | The redraw helper. |
const maxon::DrawportRedrawHelperRef& GetRedrawHelper | ( | ) | const |
Gets the redraw helper that is used for all draw operations.
const maxon::BaseArray<EditorLight>& GetEditorLights | ( | ) | const |
Gets the editor lights.
Bool IsMarkedAsGPURenderer | ( | ) |
Checks if the view is marked as GPU Renderer.
Bool IsGPURenderer | ( | ) |
Checks if the view is running the GPU Renderer.
Bool IsMarkedAsCPURenderer | ( | ) |
Returns true if the basedraw is marked as the CPU Renderer.
Bool IsCPURenderer | ( | ) |
Returns true if the basedraw is running the CPU Renderer.
void FrameFinished | ( | ) |
Private.
void GetViewportRender | ( | maxon::ViewportRenderRef & | viewportRender, |
Bool | draw | ||
) | const |
Private.
void GetDrawport | ( | maxon::DrawportRef & | drawport | ) | const |
Gets the underlying drawport.
[out] | drawport | The drawport. |
void GetDrawportContext | ( | maxon::DrawportContextRef & | context | ) | const |
Gets the underlying drawport context.
[out] | context | The context. |
void GetViewportImage | ( | maxon::ImageRef & | viewportImage | ) | const |
Gets the color framebuffer.
[in] | viewportImage | The image to write to. |
void RenderViewportWithoutPostEffects | ( | maxon::ImageRef & | image, |
const maxon::ColorProfile & | colorProfile | ||
) | const |
Renders the viewport to a 32 bit ImageRef without post effects.
[in] | image | The image to write to. |
[in] | colorProfile | Use this to force a color profile on the returned image. Defaults to current render space if passing an empty profile. |