EditorCore

class AppEventHandler : public IGenEventHandler

Basic application event handler. Depending on current settings and core mode it passes events to default event handler, to Gizmo (see GizmoEventFilter) or to Brush event handler (see BrushEventFilter

).

Additionally AppEventHandler recognizes some shortcuts and converts them to corresponding commands (also when editor is in ‘Fly’ mode).

Viewport redraw/change events handlers.

GenericEditorAppWindow &main
virtual void handleViewportPaint(IGenViewportWnd *wnd) override

Viewport CTL window redraw

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • dc[in] - viewport’s device context

virtual void handleViewChange(IGenViewportWnd *wnd) override

Viewport view change notification

Parameters:

wnd[in] - pointer to viewport window that generated the message

Mouse events handlers.

virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse move.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse left button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse left button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse right button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseRBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse right button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseCBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse center button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseCBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse center button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseWheel(IGenViewportWnd *wnd, int wheel_d, int x, int y, int key_modif) override

Handle mouse scroll wheel

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • wheel_d[in] - scroll wheel steps

  • x, y[in] - x,y coordinates inside viewport

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseDoubleClick(IGenViewportWnd *wnd, int x, int y, int key_modif) override

Handle mouse double-click

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

Public Functions

inline AppEventHandler(GenericEditorAppWindow &m)

Constructor.

Parameters:

m[in] - reference to Editor window

inline ~AppEventHandler() override

Destructor.

class ApplicationCreator : public PropPanel::DialogWindow

Public Functions

explicit ApplicationCreator(EditorWorkspace &wsp)
bool onOk() override
inline bool onCancel() override
void onChange(int pcb_id, PropPanel::ContainerPropertyControl *panel) override

Private Functions

void correctAppPath(PropPanel::ContainerPropertyControl &panel)

Private Members

EditorWorkspace &wsp
class BoxCreator : public IObjectCreator
#include <ec_ObjectCreator.h>

Used for creating boxes on scene with mouse.

Subclassed by StairCreator

Mouse events handlers.

unsigned stageNo
Point3 point0
Point3 point1
Point3 point2
real height
Point2 clientPoint0
Point2 clientPoint2
int wrapedX
int wrapedY
virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif, bool rotate = true) override

Mouse move event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

  • rotate[in] - if false

    , then box sides will be parallel to world coordinate axes

    - if

    true, then box base will be set as pointed by user

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button press event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button release event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse right button press event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual void render() override

Render BoxCreator. Called from program code that created BoxCreator.

inline unsigned getStageNo() const

Index of current creator’s stage.

Public Functions

BoxCreator()

Constructor.

class Brush
#include <ec_brush.h>

Brush.

Property Panel functions.

IBrushClient *client
IGenViewportWnd *repeatWnd
int repeatBtns
E3DCOLOR color
Point2 coord
Point2 prevCoord
Point3 center
Point3 prevCenter
Point3 normal
Point3 ignoreStepDirection
int viewDownDist
bool drawing
bool rightDrawing
real paintLen
Point3 lastPaint
real radius
real step
real stepDiv
int opacity
int hardness
bool autorepeat
int radiusPid
int opacityPid
int hardnessPid
int autorepeatPid
int stepPid
static real maxR
virtual void fillCommonParams(PropPanel::ContainerPropertyControl &group, int radius_pid, int opacity_pid, int hardness_pid, int autorepeat_pid, int step_pid = -1)

Used to place brush properties on Property Panel.

Parameters:
  • group[in] - group where brush properties to be placed

  • radius_pid[in] - property ID on Property Panel for brush radius

  • opacity_pid[in] - property ID on Property Panel for brush opacity

  • hardness_pid[in] - property ID on Property Panel for brush hardness

  • autorepeat_pid[in] - property ID on Property Panel for brush autorepeat

virtual bool updateFromPanel(PropPanel::ContainerPropertyControl *panel, int pid)

Force brush to update its property with value from Property Panel.

Parameters:
  • panel[in] - pointer to Property Panel

  • pid[in] - property ID on Property Panel

Returns:

true if update is successful

virtual void updateToPanel(PropPanel::ContainerPropertyControl &panel)

Force brush to update its property to Property Panel.

Parameters:

panel[in] - pointer to Property Panel

virtual void draw()

Brush draws itself.

virtual void repeat()

Called by Editor Core on every timer event if brush is in autorepeat mode.

inline E3DCOLOR getColor() const

Get Color of brush.

inline void setColor(E3DCOLOR col)

Set Color of brush.

inline void setStepIgnoreDirection(const Point3 &ignore_step_direction)

Set ignore step direction (default is 0,0,0)

static void addMaskList(int pid, PropPanel::ContainerPropertyControl &params, const char *def = NULL)

Used to place list of brush masks on Property Panel.

Parameters:

params[in] - ObjectParameters where masks list will be placed

static SimpleString getMaskPath(const char *mask)
virtual bool calcCenter(IGenViewportWnd *wnd)
virtual bool traceDown(const Point3 &pos, Point3 &clip_pos, IGenViewportWnd *wnd)
void sendPaintMessage(IGenViewportWnd *wnd, int btns, int keys, bool moved)

Methods to get / set brush properties.

inline real getRadius() const

Get brush radius.

Returns:

brush radius

inline real getRadiusSq() const

Get brush square radius.

Returns:

square of brush radius

inline real getStep() const

Get brush step.

Returns:

brush step (step = radius / step divider)

inline real getStepDiv() const

Get brush step divider (used to calculate brush step).

Returns:

brush step devider

inline int getOpacity() const

Get brush opacity.

Returns:

brush opacity (0-100)

inline int getHardness() const

Get brush hardness.

Returns:

brush hardness (0-100)

inline float getHardnessFromDistance(real dist) const

Get brush hardness from distance.

Returns:

brush hardness (0-100)

inline bool isRepeat() const

Tests whether brush is in repeat mode. In repeat mode pressed left mouse button will call periodically an event IBrushClient::onBrushPaint().

Returns:

true if brush is in repeat mode

inline bool isDrawingInProgress() const

Tests whether the brush is currently drawing (either with the left or the right mouse button).

Returns:

true if drawing

inline real setRadius(real r)

Set brush radius.

Parameters:

r[in] - brush radius

inline void setMaxRadius(real r)
inline void setStepDiv(real div)

Set brush step divider.

Parameters:

div[in] - step divider

inline void setOpacity(int o)

Set brush opacity.

Parameters:

o[in] - brush opacity

inline void setHardness(int h)

Set brush hardness.

Parameters:

h[in] - brush hardness

inline void setRepeat(bool repeat)

Set brush autorepeat.

Parameters:

repeat[in] - true / false - set autorepeat on / off

Mouse events.

virtual void mouseMove(IGenViewportWnd *wnd, int x, int y, int btns, int keys)

Notify the brush about mouse move. Called by Editor Core.

Parameters:
  • wnd[in] - pointer to interface IGenViewportWnd of the viewport window that generated the event

  • x, y[in] - x, y mouse coordinates

  • btns[in] - mouse buttons

  • keys[in] - shift keys state (see #CtlShiftKeys)

virtual void mouseLBPress(IGenViewportWnd *wnd, int x, int y, int btns, int keys)

Notify the brush that left mouse button is pressed. Called by Editor Core.

Parameters:
  • wnd[in] - pointer to interface IGenViewportWnd of the viewport window that generated the event

  • x, y[in] - x, y mouse coordinates

  • btns[in] - mouse buttons

  • keys[in] - shift keys state (see #CtlShiftKeys)

virtual void mouseLBRelease(IGenViewportWnd *wnd, int x, int y, int btns, int keys)

Notify the brush that left mouse button is released. Called by Editor Core.

Parameters:
  • wnd[in] - pointer to interface IGenViewportWnd of the viewport window that generated the event

  • x, y[in] - x, y mouse coordinates

  • btns[in] - mouse buttons

  • keys[in] - shift keys state (see #CtlShiftKeys)

virtual void mouseRBPress(IGenViewportWnd *wnd, int x, int y, int btns, int keys)

Notify the brush that right mouse button is pressed. Called by Editor Core.

Parameters:
  • wnd[in] - pointer to interface IGenViewportWnd of the viewport window that generated the event

  • x, y[in] - x, y mouse coordinates

  • btns[in] - mouse buttons

  • keys[in] - shift keys state (see #CtlShiftKeys)

virtual void mouseRBRelease(IGenViewportWnd *wnd, int x, int y, int btns, int keys)

Notify the brush that right mouse button is released. Called by Editor Core.

Parameters:
  • wnd[in] - pointer to interface IGenViewportWnd of the viewport window that generated the event

  • x, y[in] - x, y mouse coordinates

  • btns[in] - mouse buttons

  • keys[in] - shift keys state (see #CtlShiftKeys)

Public Functions

Brush(IBrushClient *bc)

Constructor.

Parameters:

bc[in] - pointer to interface IBrushClient by means of which client code will be notified about brush events

Public Static Attributes

static const int MAX_TRACE_DIST = 2700

Maximum raytrace distance which brushes use by default.

class BrushEventFilter : public IGenEventHandler
#include <ec_brushfilter.h>

Used to receive messages from editor core engine and send them to current brush (if it is set). Message sending begins after call to IEditorCoreEngine::beginBrushPaint() (at that time BrushEventFilter is activated) and ends after call to IEditorCoreEngine::endBrushPaint().

Viewport redraw/change events handlers.

Brush *curBrush
bool active
inline virtual void handleViewportPaint(IGenViewportWnd *wnd) override

Viewport CTL window redraw

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • dc[in] - viewport’s device context

inline virtual void handleViewChange(IGenViewportWnd *wnd) override

Viewport view change notification

Parameters:

wnd[in] - pointer to viewport window that generated the message

Mouse events handlers.

virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handles mouse move. The function calls Brush::mouseMove().

Handle mouse move.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handles mouse left button press. The function calls Brush::mouseLBPress().

Handle mouse left button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handles mouse left button release. The function calls Brush::mouseLBRelease().

Handle mouse left button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handles mouse right button press. The function calls Brush::mouseRBPress().

Handle mouse right button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseRBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handles mouse right button release. The function calls Brush::mouseRBRelease().

Handle mouse right button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseCBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse center button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseCBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse center button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseWheel(IGenViewportWnd *wnd, int wheel_d, int x, int y, int key_modif) override

Handle mouse scroll wheel

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • wheel_d[in] - scroll wheel steps

  • x, y[in] - x,y coordinates inside viewport

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseDoubleClick(IGenViewportWnd *wnd, int x, int y, int key_modif) override

Handle mouse double-click

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

Public Functions

BrushEventFilter()

Constructor.

inline bool isActive() const

Test whether BrushEventFilter is active.

Returns:

true if BrushEventFilter is active, false in other case

inline void setBrush(Brush *brush)

Set current brush.

Parameters:

brush[in] - pointer to Brush

inline Brush *getBrush() const

Get current brush.

Returns:

brush - pointer to Brush

inline void activate()

Activate BrushEventFilter.

inline void deactivate()

Deactivate BrushEventFilter.

void renderBrush()

Render current brush.

struct Cam
#include <ec_camera_elem.h>

Public Members

float curDist
Point2 ang
bool changed
struct CameraConfig
#include <ec_camera_dlg.h>

Camera parameters.

Subclassed by FpsCameraConfig

Public Functions

virtual void load(const DataBlock &blk)

Load camera parameters from BLK file.

Parameters:

blk[in] - Data Block that contains data to load (see #DataBlock)

virtual void save(DataBlock &blk)

Save camera parameters to BLK file.

Parameters:

blk[in] - Data Block that contains data to save (see #DataBlock)

inline CameraConfig()

Constructor.

inline virtual ~CameraConfig()

Public Members

real moveStep

moveWnd step.

real rotationStep

Rotation step.

real strifeStep

Strafe step. For this version of Editor Core strifeStep == moveStep.

real controlMultiplier

Speed / rotation multiplier factor, acting when [Ctrl] key is held down.

real speedChangeMultiplier

Speed change multiplier factor when using the mouse wheel.

Inertia commonInertia

Camera’s moving inertia.

Inertia hangInertia

Camera’s rotation inertia in horizontal plane.

Inertia vangInertia

Camera’s rotation inertia in vertical plane. For this version of Editor Core vangInertia == hangInertia.

class CamerasConfigDlg : public PropPanel::DialogWindow
#include <ec_camera_dlg.h>

Public Functions

CamerasConfigDlg(void *phandle, CameraConfig *max_cc, CameraConfig *free_cc, CameraConfig *fps_cc, CameraConfig *tps_cc)
~CamerasConfigDlg() override
void fill()

Protected Functions

void onChange(int pcb_id, PropPanel::ContainerPropertyControl *panel) override

Protected Attributes

PropPanel::ContainerPropertyControl *mTabPage
CameraConfig *mConfig
FreeCameraTab *mFreeCameraTab
FPSCameraTab *mFPSCameraTab
TPSCameraTab *mTPSCameraTab
class CapsuleCreator : public CylinderCreator
#include <ec_ObjectCreator.h>

Public Functions

virtual void render() override

Render BoxCreator. Called from program code that created BoxCreator.

class CarCameraElem : public TpsCameraElem
#include <ec_camera_elem.h>

Public Functions

CarCameraElem()
~CarCameraElem() override
bool begin()
void end()
virtual void actInternal() override
virtual void render() override
virtual void externalRender()
virtual void handleMouseWheel(int dz) override

Handle mouse wheel rotation.

Parameters:

delta[in] - if it’s > 0 then the wheel was rotated forward (away from user), if < 0 then it was rotated backward

Protected Attributes

float zoom
VehicleViewer *vehicleViewer
CameraController *camController
class CCameraElem
#include <ec_camera_elem.h>

The class for managing cameras.

Subclassed by FpsCameraElem, FreeCameraElem, MaxCameraElem, TpsCameraElem

Camera manipulation methods.

CameraConfig *config
bool setAboveSurfFuture
bool initPosition
real forwardZFuture
real forwardZCurrent
real rotateXFuture = 0.f
real rotateXCurrent
real rotateYFuture = 0.f
real rotateYCurrent
real strifeXFuture
real strifeXCurrent
real strifeYFuture
real strifeYCurrent
real upYCurrent
real upYFuture
bool multiply
bool bow
bool aboveSurface
int thisCamType
static IGenViewportWnd *vpw
static int currentType
static IPoint2 freeCamEnterPos
virtual void rotate(real dX, real dY, bool multiplySencetive, bool aroundSelection)

Rotate camera.

Parameters:
  • dX, dY[in] - rotation angles for X,Y axes

  • multiplySencetive[in] - true: use acceleration, false: camera is not accelerated

  • aroundSelection[in] - true: use rotation center, false: rotation center is not used

virtual void moveForward(real dZ, bool multiplySencetive, IGenViewportWnd *wnd = NULL)

Move camera in Z direction.

Parameters:
  • dZ[in] - camera Z-shift

  • multiplySencetive[in] - true: use acceleration, false: camera is not accelerated

  • wnd[in] - pointer to viewport window

virtual void strife(real dx, real dy, bool multiply_sencetive, bool config_sencetive)

Strife camera (move along X,Y surface).

Parameters:
  • dx, dy[in] - camera shift in X,Y directions

  • multiply_sencetive[in] - true: use acceleration, false: camera is not accelerated

  • config_sencetive[in] - true: use camera’s ‘Turbo’ coefficient (acceleration for ‘free’ / ‘FPS’ camera if [Shift] key pressed), false: ‘Turbo’ coefficient is not used

inline void act()
virtual void render()
virtual void clear()
void setAboveSurf()
void moveUp(real deltaY, bool multiplySencetive)
Point3 getSurfPos(const Point3 &pos)
virtual bool canPutCapsule(const Point3 &pt)
virtual void actInternal()
void stop()
static inline void setCamera(int type_)

Camera config.

inline CameraConfig *getConfig()

Get camera config.

Returns:

pointer to camera config

void load(const DataBlock &blk)

Load config data from blk file.

Parameters:

blk[in] - Data Block that contains data to load (see #DataBlock)

void save(DataBlock &blk)

Save config data to blk file.

Parameters:

blk[in] - Data Block that contains data to save (see #DataBlock)

Keyboard / mouse events.

virtual void handleKeyboardInput(unsigned viewport_id)

Handle keyboard input using polling.

inline void handleMouseMove(int x, int y)

Handle mouse move.

Parameters:

x, y[in] - x,y mouse coordinates in viewport

virtual void handleMouseWheel(int delta)

Handle mouse wheel rotation.

Parameters:

delta[in] - if it’s > 0 then the wheel was rotated forward (away from user), if < 0 then it was rotated backward

Public Types

Values:

enumerator FREE_CAMERA

‘Free’ camera

enumerator MAX_CAMERA

‘Max-like’ camera

enumerator FPS_CAMERA

‘FPS’ camera

enumerator TPS_CAMERA

‘TPS’ camera

enumerator CAR_CAMERA

‘CAR’ camera

Public Functions

CCameraElem(int cam_type)

Constructor.

virtual ~CCameraElem()

Destructor.

inline void setMultiply(bool multiply_)

Set camera acceleration flag (to use acceleration).

Parameters:

multiply_[in] - true / false: set / clear camera acceleration flag

real getMultiplier()

Get acceleration multiplier.

Returns:

camera’s acceleration multiplier

void setAboveSurface(bool above_surface)

Set ‘above surface fly’ flag. Set / clear flag indicating ‘fps’ camera mode.

Parameters:

above_surface[in] - true:

set ‘above surface fly’ flag (‘fps’ camera mode)

-

false: clear flag

Public Static Functions

static inline void setViewportWindow(IGenViewportWnd *vpw_)

Set camera’s viewport window.

Parameters:

vpw_[in] - pointer to viewport window

static inline int getCamera()

Get current camera type.

Returns:

camera type (see class’s enum)

static void switchCamera(bool ctrl_pressed, bool shift_pressed)

Switch camera between ‘max-like’, ‘free’ and ‘fps’ modes with [Space], [Ctrl+Space] shortcuts.

Parameters:

ctrl_pressed[in] - true if [Ctrl] key pressed, false in other case

static void showConfigDlg(void *parent, CameraConfig *max_cc, CameraConfig *free_cc, CameraConfig *fps_cc, CameraConfig *tps_cc)

Show cameras configuration dialog window.

Parameters:
  • parent[in] - pointer to parent window

  • max_cc[in] - pointer to ‘max-like’ camera config

  • free_cc[in] - pointer to ‘free’ camera config

  • fps_cc[in] - pointer to ‘fps’ camera config

class CircleCreator : public SphereCreator
#include <ec_ObjectCreator.h>

Public Functions

virtual void render() override

Render BoxCreator. Called from program code that created BoxCreator.

class CylinderCreator : public IObjectCreator
#include <ec_ObjectCreator.h>

Subclassed by CapsuleCreator, SpiralStairCreator

Public Functions

CylinderCreator()
virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif, bool rotate = true) override

Mouse move event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

  • rotate[in] - if false

    , then box sides will be parallel to world coordinate axes

    - if

    true, then box base will be set as pointed by user

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button press event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button release event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse right button press event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual void render() override

Render BoxCreator. Called from program code that created BoxCreator.

Protected Attributes

unsigned stageNo
Point3 point0
Point3 point1
Point2 clientPoint
int wrapedX
int wrapedY
struct DelayedMouseEvent

Public Members

int x
int y
bool inside
int buttons
int modifierKeys
struct DragData

Public Members

int objectType
int perTypeLayerIndex
struct EcRect
#include <ec_rect.h>

Public Functions

inline int operator!=(EcRect &r2)
inline int operator==(EcRect &r2)
inline int width() const
inline int height() const

Public Members

int l
int t
int r
int b
class EditableObject : public DObject
#include <ec_object.h>

Base class for Editor objects. Most of objects used in EditorCore based editors are derived from EditableObject.

Subclassed by RenderableEditableObject

RTTI implementation.

String name
TMatrix matrix
inline bool isSubOf(DClassID cid) override
inline virtual DClassID getClassId()
inline virtual const char *getName() const

Get object name.

Returns:

pointer to object name

inline virtual Point3 getPos() const

Get object position.

Returns:

object position

inline virtual TMatrix getTm() const

Get object matrix.

Returns:

object tmatrix

virtual bool setName(const char *nm) = 0

Set object name.

Parameters:

nm[in] - pointer to string with object name

Returns:

true if operation successful, false in other case

virtual bool setPos(const Point3 &p) = 0

Set object position.

Parameters:

p[in] - object position

Returns:

true if operation successful, false in other case

virtual bool isSelectedByPointClick(IGenViewportWnd *vp, int x, int y) const = 0

Test whether mouse cursor is on the object.

Parameters:
  • vp[in] - pointer to viewport where test is performed

  • x, y[in] - x,y mouse cursor coordinates

Returns:

true if mouse cursor is on the object, false in other case

static inline DClassID getStaticClassId()

Public Functions

inline EditableObject()

Constructor 1.

inline EditableObject(const EditableObject &from)

Constructor 2.

inline ~EditableObject() override

Destructor.

class EditorMainWindow
#include <ec_mainWindow.h>

Public Types

typedef eastl::function<bool(const dag::Vector<String> &files)> FileDropHandler

Public Functions

explicit EditorMainWindow(IWndManagerEventHandler &event_handler)
void run(const char *caption, const char *icon, FileDropHandler file_drop_handler = nullptr, E3DCOLOR bg_color = E3DCOLOR(229, 229, 229))
intptr_t windowProc(void *h_wnd, unsigned msg, void *w_param, void *l_param)

Private Functions

IWndManager *createWindowManager()
void onMainWindowCreated()
void onClose()
void close()
bool onMouseButtonDown(int button)
bool onMouseButtonUp(int button)

Private Members

IWndManagerEventHandler &eventHandler
void *mainHwnd = nullptr
eastl::unique_ptr<IWndManager> wndManager
FileDropHandler fileDropHandler
class EditorStartDialog : public PropPanel::DialogWindow, public PropPanel::IDelayedCallbackHandler
#include <ec_startDlg.h>

Public Functions

EditorStartDialog(const char *caption, EditorWorkspace &wsp, const char *wsp_blk, const char *select_wsp)
~EditorStartDialog() override
void editWorkspace()
inline const String &getStartWorkspace() const
int getWorkspaceIndex(const char *name) const
bool onOk() override
inline bool onCancel() override
void onChange(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
void onClick(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
inline virtual void onCustomFillPanel(PropPanel::ContainerPropertyControl &panel)
inline virtual bool onCustomSettings(PropPanel::ContainerPropertyControl &panel)

Protected Functions

inline int getCustomTop() const
inline bool isWspEditing() const
void onImguiDelayedCallback(void *user_data) override
void updateImguiDialog() override
inline virtual void createCustom()
virtual void onChangeWorkspace(const char *name)
virtual void onAddWorkspace()
virtual void onEditWorkspace()
void reloadWsp()
void updateOkButtonState()

Protected Attributes

EditorWorkspace &wsp

Private Functions

void initWsp(bool init_combo)

Private Members

String startWsp
String blkName
bool editWsp
bool wspInited
bool showAddWorkspaceDialog = false
bool selectedWorkspaceValid = false
int customTop
class EditorWorkspace
#include <ec_workspace.h>

Public Functions

EditorWorkspace()
virtual ~EditorWorkspace()
bool initWorkspaceBlk(const char *path)
void freeWorkspaceBlk()
void getWspNames(Tab<String> &list) const
bool load(const char *workspace_name, bool *app_path_set = NULL)
bool loadIndirect(const char *app_blk_path)
bool save()
bool remove()
inline void setName(const char *new_name)
void setAppPath(const char *new_path)
inline const char *getName() const
inline const char *getAppDir() const
inline const char *getAppPath() const
inline const char *getSdkDir() const
inline const char *getLibDir() const
inline const char *getLevelsDir() const
inline const char *getResDir() const
inline const char *getScriptDir() const
inline const char *getAssetScriptDir() const
inline const char *getGameDir() const
inline const char *getLevelsBinDir() const
inline const char *getPhysmatPath() const
inline const char *getScriptLibrary() const
inline const char *getCollisionName() const
inline const Tab<String> &getDagorEdDisabled() const
inline const Tab<String> &getResourceEdDisabled() const
inline dag::ConstSpan<unsigned> getAdditionalPlatforms() const
inline float getMaxTraceDistance() const

Public Static Functions

static unsigned getPlatformFromStr(const char *platf)
static const char *getPlatformNameFromId(unsigned plt)

Protected Functions

inline virtual bool loadSpecific(const DataBlock &blk)
inline virtual bool loadAppSpecific(const DataBlock &blk)
inline virtual bool saveSpecific(DataBlock &blk)
virtual bool createApplicationBlk(const char *path) const

Protected Attributes

String blkPath
Workspaces *wspData

Private Functions

DataBlock *findWspBlk(DataBlock &blk, const char *wsp_name, bool create_new)
bool loadFromBlk(DataBlock &blk, bool *app_path_set = NULL)

Private Members

String name
String appDir
String appPath
String sdkDir
String libDir
String levelsDir
String resDir
String scriptDir
String assetScriptsDir
String gameDir
String levelsBinDir
String physmatPath
String scriptLibrary
String collisionName
Tab<String> deDisabled
Tab<String> reDisabled
Tab<unsigned> platforms
float maxTraceDistance
struct FpsCameraConfig : public CameraConfig
#include <ec_camera_dlg.h>

FPS Camera parameters.

Subclassed by TpsCameraConfig

Public Functions

inline FpsCameraConfig()

Constructor.

inline ~FpsCameraConfig() override

Destructor.

virtual void load(const DataBlock &blk) override

Load camera parameters from BLK file.

Parameters:

blk[in] - Data Block that contains data to load (see #DataBlock)

virtual void save(DataBlock &blk) override

Save camera parameters to BLK file.

Parameters:

blk[in] - Data Block that contains data to save (see #DataBlock)

Public Members

real radius

Radius of the capsula (representing FPS camera).

real height

Height above collision for FPS camera.

real halfHeight

Height above collision for FPS camera with key [C] pressed (bowing mode).

real stepHeight

Step height FPS camera may climb up.

real stepHalfHeight

Step height FPS camera may climb up with key [C] pressed (bowing mode).

real gravity
real jumpSpeed
class FpsCameraElem : public CCameraElem
#include <ec_camera_elem.h>

Public Functions

FpsCameraElem()
virtual void actInternal() override
inline virtual void render() override
virtual void clear() override
virtual void handleKeyboardInput(unsigned viewport_id) override

Handle keyboard input using polling.

virtual void moveForward(real deltaZ, bool multiplySencetive, IGenViewportWnd *wnd) override

Move camera in Z direction.

Parameters:
  • dZ[in] - camera Z-shift

  • multiplySencetive[in] - true: use acceleration, false: camera is not accelerated

  • wnd[in] - pointer to viewport window

virtual void strife(real dx, real dy, bool multiply_sencetive, bool config_sencetive) override

Strife camera (move along X,Y surface).

Parameters:
  • dx, dy[in] - camera shift in X,Y directions

  • multiply_sencetive[in] - true: use acceleration, false: camera is not accelerated

  • config_sencetive[in] - true: use camera’s ‘Turbo’ coefficient (acceleration for ‘free’ / ‘FPS’ camera if [Shift] key pressed), false: ‘Turbo’ coefficient is not used

void moveOn(const Point3 &dpos)

Protected Attributes

Point3 pos
Point3 prevPos
Point3 speed
Point3 accelerate
bool mayJump
class FPSCameraTab : public FreeCameraTab
#include <ec_camera_dlg.h>

Subclassed by TPSCameraTab

Public Functions

FPSCameraTab(PropPanel::ContainerPropertyControl *tab_page, CameraConfig *options)
void fill()
void updateConfigFromUserInterface(int pcb_id)
class FreeCameraElem : public CCameraElem
#include <ec_camera_elem.h>

Public Functions

inline FreeCameraElem()
virtual void actInternal()
class FreeCameraTab
#include <ec_camera_dlg.h>

Subclassed by FPSCameraTab

Public Functions

FreeCameraTab(PropPanel::ContainerPropertyControl *tab_page, CameraConfig *options)
void fill()
void updateConfigFromUserInterface(int pcb_id)

Protected Attributes

PropPanel::ContainerPropertyControl *mTabPage
CameraConfig *mConfig
class GeneralEditorData
#include <ec_geneditordata.h>

A class for storing general Editor parameters.

Viewport functions

IGenEventHandler *curEH

Default event handler.

ToolBarManager *tbManager

Toolbar manager.

Tab<ViewportWindow*> vpw

Array of pointers to viewports.

int viewportLayout

Viewports layout. Posible values is defined in EditorCoreCM:

/// CM_VIEWPORT_LAYOUT_1     - one viewport
/// CM_VIEWPORT_LAYOUT_2VERT - two vertical viewports
/// CM_VIEWPORT_LAYOUT_2HOR  - two horizontal viewports
/// CM_VIEWPORT_LAYOUT_4     - four viewports

IEditorCoreEngine::ViewportCacheMode vcmode

Viewport cache mode.

int currentViewportId

Last active viewport number.

void addViewport(void *parent, IGenEventHandler *eh, IWndManager *manager, ViewportWindow *v)

Use this instead of createViewport if you want to add a subclassed ViewportWindow.

ViewportWindow *createViewport(void *parent, int x, int y, int w, int h, IGenEventHandler *eh, IWndManager *manager)

Creates new viewport.

void deleteViewport(int n)

Deletes viewport with specified index.

inline int getViewportCount() const

Gets viewport count.

void setEH(IGenEventHandler *eh)

Set event handler for all viewports.

Parameters:

eh[in] - pointer to event handler

ViewportWindow *getActiveViewport() const

Get active viewport.

Returns:

- pointer to active viewport,

-

NULL if all viewports are not active

inline void activateCurrentViewport() const

Activate current viewport.

inline ViewportWindow *getCurrentViewport() const

Get last active viewport.

Returns:

- pointer to the last active viewport

-

NULL if no viewports were active yet

inline int getCurrentViewportId() const

Get ID of last active viewport.

Returns:

- index of last active viewport

-

-1 if no viewports were active yet

inline void setCurrentViewportId(int id)
ViewportWindow *getRenderViewport() const

Get rendering viewport.

Returns:

- pointer to viewport that is rendering now

-

NULL if no rendering viewports

inline ViewportWindow *getViewport(int n) const

Get viewport by index.

Parameters:

n[in] - viewport index

Returns:

pointer to viewport

int findViewportIndex(IGenViewportWnd *w) const

Find viewport index.

Parameters:

w[in] - pointer to viewport

Returns:

- viewport index

-

#VIEWPORT_NUM - 1 if viewport not found

IGenViewportWnd *screenToViewport(int &x, int &y) const

Returns pointer to viewport containing specified point.

Parameters:
  • x, y[in] - point coordinates

  • x, y[out] - viewport point coordinates

Returns:

pointer to viewport containing specified point

void setViewportCacheMode(IEditorCoreEngine::ViewportCacheMode mode)

Set viewports cache mode.

Parameters:

mode[in] - viewport cache mode (see IEditorCoreEngine::ViewportCacheMode)

void invalidateCache()

Update viewports cache.

void setZnearZfar(real zn, real zf)

Set camera clipping for all viewports.

Parameters:
  • zn[in] - z-near, a distance to nearest visible parts of scene (all parts more close to camera will be invisible)

  • zf[in] - z-far, a distance to the farthest visible parts of scene (all parts more distant from camera will be invisible)

void act(real dt)

Called by EditorCore at the act stage. This function calls act() function of viewports and toolbar manager, stores last active viewport.

void redrawClientRect()

The function calls ViewportWindow::redrawClientRect() for all viewports.

inline int getViewportLayout()
inline void setViewportLayout(int value)

Public Functions

GeneralEditorData()

Constructor.

Parameters:

main_wnd[in] - pointer to main Editor’s window. Used as parent window in viewport creating functions.

~GeneralEditorData()

Destructor.

void load(const DataBlock &blk)

Load data from blk file.

Parameters:

blk[in] - Data Block that contains data to load (see #DataBlock)

void save(DataBlock &blk) const

Save data to blk file.

Parameters:

blk[in] - Data Block that contains data to save (see #DataBlock)

class GenericEditorAppWindow : public PropPanel::IMenuEventHandler, public IUndoRedoWndClient
#include <ec_genappwnd.h>

Editor’s main window. In EditorCore based editors main window is usually derived from GenericEditorAppWindow and IEditorCoreEngine classes.

Public Functions

GenericEditorAppWindow(const char *open_fname, IWndManager *manager)

Constructor.

Parameters:

open_fname[in] - path to the project to open on application start

virtual ~GenericEditorAppWindow()

Destructor.

virtual bool canClose()

Test whether application window may be closed (that is the editor may be exited).

Returns:

true if application window may be closed, false in other case

virtual void startWith(const char *select_workspace = nullptr)

Show dialog window on application start, where one may select start up action:.

- Create new project

- Open existing project

- Open recent project

void updateUndoRedoMenu() override

update Undo / Redo menu items. update undo / redo menu text - set names for undo / redo operations.

void saveViewportsParams(DataBlock &blk) const

Save viewports parameters to BLK file.

Parameters:

blk[in] - Data Block that contains data to save (see DataBlock)

void loadViewportsParams(const DataBlock &blk)

Load viewports parameters from BLK file.

Parameters:

blk[in] - Data Block that contains data to load (see DataBlock)

inline void setQuietMode(bool mode)
String getThemeFileName() const
void saveThemeSettings(DataBlock &blk) const
void loadThemeSettings(const DataBlock &blk)
void saveScreenshotSettings(DataBlock &blk) const
void loadScreenshotSettings(const DataBlock &blk)
inline bool isRenderingOrtScreenshot()
inline bool isOrthogonalPreview()
inline EditorWorkspace &getWorkspace()

Public Static Attributes

static constexpr const char *defaultThemeName = "light"

Protected Functions

virtual bool handleNewProject(bool edit = false) = 0
virtual bool handleOpenProject(bool edit = false) = 0
virtual void getDocTitleText(String &text)
virtual void setDocTitle()
virtual bool createNewProject(const char *filename) = 0
virtual bool loadProject(const char *filename) = 0
virtual bool saveProject(const char *filename) = 0
virtual bool canCloseScene(const char *title)
virtual void init(const char *select_workspace = nullptr)
PropPanel::IMenu *getMainMenu()
virtual void fillMenu(PropPanel::IMenu *menu)
inline virtual void updateMenu(PropPanel::IMenu *menu)
virtual void addExitCommand(PropPanel::IMenu *menu)
void onChangeFov()
void onShowConsole()
void fillCommonToolbar(PropPanel::ContainerPropertyControl &tb)
virtual String getScreenshotNameMask(bool cube) const = 0
virtual void screenshotRender(bool skip_debug_objects) = 0
String getScreenshotName(bool cube) const
void setScreenshotOptions(ScreenshotDlgMode mode)
void closeScreenshotSettingsDialog()
Texture *renderInTex(int w, int h, const TMatrix *tm, bool skip_debug_objects = false, bool should_make_orthogonal_screenshot = false, bool should_use_z_buffer = true, float world_x0 = 0.f, float world_x1 = 0.f, float world_z0 = 0.f, float world_z1 = 0.f)
void createScreenshot()
void createCubeScreenshot()
void createOrthogonalScreenshot(const char *dest_folder = NULL, const float *x0z0x1z1 = NULL)
void saveOrthogonalScreenshot(const char *fn, int mip_level, float _x, float _z, float tile_in_meters)
void renderOrtogonalCells()
int getMaxRTSize()
int onMenuItemClick(unsigned id) override

Protected Attributes

IWndManager *mManager
GizmoEventFilter *gizmoEH
BrushEventFilter *brushEH
IGenEventHandler *appEH
char sceneFname[260]
bool shouldLoadFile
bool shouldUpdateViewports
UndoSystem *undoSystem
struct GenericEditorAppWindow::WorldCursorParams cursor
struct GenericEditorAppWindow::WorldCursorParams cursorLast
GeneralEditorData ged
GridObject grid
CoolConsole *console
bool quietMode
String themeName
ScreenshotConfig screenshotCfg
ScreenshotConfig cubeScreenshotCfg
OrtMultiScrData mScrData
OrtScrCells mScrCells
bool isRenderingOrtScreenshot_

Private Members

EditorWorkspace mWSpace
eastl::unique_ptr<PropPanel::IMenu> mainMenu
class GizmoEventFilter : public IGenEventHandler
#include <ec_gizmofilter.h>

Gizmo implementation. The class renders Gizmo, handles Gizmo events, calls proper functions of linked Gizmo client (see IGizmoClient).

Public Types

enum SelectedAxes

Values:

enumerator AXIS_X
enumerator AXIS_Y
enumerator AXIS_Z
enum class Style : int

Values:

enumerator Classic
enumerator New

Public Functions

GizmoEventFilter(GeneralEditorData &ged, const GridObject &grid)

Constructor.

Parameters:
  • ged[in] - reference to Editor’s GeneralEditorData

  • grid[in] - reference to Editor grid

void endGizmo(bool apply)

End the currently onging gizmo operation the same way as if the user finished it by releasing the left mouse button or canceled it by pressing the right mouse button.

Parameters:

apply[in] - whether the apply or cancel the onging operation

virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse move.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse left button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse left button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse right button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseRBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse right button release

The function just passes event to Editor’s event handler.

Handle mouse right button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseCBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse center button press

The function just passes event to Editor’s event handler.

Handle mouse center button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseCBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse center button release

The function just passes event to Editor’s event handler.

Handle mouse center button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseWheel(IGenViewportWnd *wnd, int wheel_d, int x, int y, int key_modif) override

Handle mouse scroll wheel

The function just passes event to Editor’s event handler.

Handle mouse scroll wheel

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • wheel_d[in] - scroll wheel steps

  • x, y[in] - x,y coordinates inside viewport

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseDoubleClick(IGenViewportWnd *wnd, int x, int y, int key_modif) override

Handles mouse double-click

The function just passes event to Editor’s event handler.

Handle mouse double-click

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual void handleViewportPaint(IGenViewportWnd *wnd) override

Render Gizmo.

Viewport CTL window redraw

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • dc[in] - viewport’s device context

virtual void handleViewChange(IGenViewportWnd *wnd) override

Rerender Gizmo in accordance with its new view in viewport.

Viewport view change notification

Parameters:

wnd[in] - pointer to viewport window that generated the message

void setGizmoStyle(Style style)
inline void setGizmoType(IEditorCoreEngine::ModeType type)
inline void setGizmoClient(IGizmoClient *client)
inline void zeroOverAndSelected()
Style getGizmoStyle() const
inline IEditorCoreEngine::ModeType getGizmoType() const
inline IGizmoClient *getGizmoClient() const
inline Point3 getMoveDelta() const
void correctCursorInSurfMove(const Point3 &delta)
inline bool isStarted() const

Protected Functions

void startGizmo(IGenViewportWnd *wnd, int x, int y)
void drawGizmo(IGenViewportWnd *w)
void recalcViewportGizmo()
bool checkGizmo(IGenViewportWnd *wnd, int x, int y)

Protected Attributes

struct GizmoEventFilter::GizmoParams gizmo
GeneralEditorData &ged
const GridObject &grid
Tab<VpInfo> vp
Tab<VpInfo> s_vp
Point3 scale
Point2 gizmoDelta
Point2 mousePos
Point2 mouseCurrentPos
Point3 startPos
Tab<Point2> startPos2d
real rotAngle
real startRotAngle
int deltaX
int deltaY
Point3 movedDelta
Point3 planeNormal
bool moveStarted
Point2 rotateDir
eastl::unique_ptr<IGizmoRenderer> renderer

Private Functions

inline void repaint()
void surfaceMove(IGenViewportWnd *wnd, int x, int y, int vp_i, const Point3 &pos, Point3 &move_delta)
struct GizmoParams
#include <ec_gizmofilter.h>

Public Members

IEditorCoreEngine::ModeType prevMode
int over
int selected
IGizmoClient *client
IEditorCoreEngine::ModeType type
class GizmoSettingsDialog : public PropPanel::DialogWindow

Public Functions

GizmoSettingsDialog()

Private Functions

void fillPanel()
void onChange(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
class GridEditDialog : public PropPanel::DialogWindow
#include <ec_gridobject.h>

Public Functions

GridEditDialog(void *phandle, GridObject &grid, const char *caption)
void showGridEditDialog(int viewport_index)
void onGridVisibilityChanged(int viewport_index)

Private Functions

void onChange(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
void fillPanel()
void updateShowGridDialogControl()

Private Members

GridObject &mGrid
int index = -1
class GridObject
#include <ec_gridobject.h>

Grid object. Used for representing Editor grid.

Test ‘snap toggle’ buttons

static const int VIS_CNT = 4
bool visible[VIS_CNT]
real step
real angleStep
real scaleStep
real gridHeight
bool isMoveSnap
bool isRotateSnap
bool isScaleSnap
bool isDrawMajorLines
bool isDrawAxisLines
bool infiniteGridInitialized
Ptr<ShaderMaterial> infiniteGridShaderMaterial
Ptr<ShaderElement> infiniteGridShaderElement
bool isUseInfiniteGrid
E3DCOLOR infiniteGridMajorLineColor
E3DCOLOR infiniteGridMinorLineColor
E3DCOLOR infiniteGridXAxisColor
E3DCOLOR infiniteGridZAxisColor
real infiniteGridMajorLineWidth
real infiniteGridMinorLineWidth
int infiniteGridMajorSubdivisions
inline bool getMoveSnap() const

Test whether ‘Move snap toggle’ button pressed.

Returns:

true if ‘Move snap toggle’ button is in pressed state, false in other case

inline void setMoveSnap(bool is_snap)

Set ‘Move’ snap flag.

Parameters:

is_snap[in] - true / false: set / clear snap property

inline bool getRotateSnap() const

Test whether ‘Rotate snap toggle’ button pressed.

Returns:

true if ‘Rotate snap toggle’ button is in pressed state, false in other case

inline void setRotateSnap(bool is_snap)

Set ‘Rotate’ snap flag.

Parameters:

is_snap[in] - true / false: set / clear snap property

inline bool getScaleSnap() const

Test whether ‘Scale snap toggle’ button pressed.

Returns:

true if ‘Scale snap toggle’ button is in pressed state, false in other case

inline void setScaleSnap(bool is_snap)

Set ‘Scale’ snap flag.

Parameters:

is_snap[in] - true / false: set / clear snap property

inline bool getDrawMajorLines()
inline void setDrawMajorLines(bool draw)
inline bool getDrawAxisLines()
inline void setDrawAxisLines(bool draw)
inline real getGridHeight()
inline void setGridHeight(real new_height)
inline bool getUseInfiniteGrid() const
inline void setUseInfiniteGrid(bool infinite)
inline E3DCOLOR getInfiniteGridMajorLineColor() const
inline void setInfiniteGridMajorLineColor(E3DCOLOR color)
inline E3DCOLOR getInfiniteGridMinorLineColor() const
inline void setInfiniteGridMinorLineColor(E3DCOLOR color)
inline real getInfiniteGridMajorLineWidth() const
inline void setInfiniteGridMajorLineWidth(real width)
inline real getInfiniteGridMinorLineWidth() const
inline void setInfiniteGridMinorLineWidth(real width)
inline int getInfiniteGridMajorSubdivisions() const
inline void setInfiniteGridMajorSubdivisions(int subdivisions)
void resetToDefault()
void renderInfiniteGrid()

Get grid properties.

inline bool isVisible(int idx) const

Test whether the grid is visible in specified viewport.

Parameters:

idx[in] - viewport index

Returns:

true if the grid is visible, false in other case

inline real getStep() const

Get object move step.

Returns:

objects move step (in metres)

inline real getAngleStep() const

Get object rotation step.

Returns:

objects rotation step (in degrees)

inline real getScaleStep() const

Get object scaling step.

Returns:

objects scaling step (in percent from original size)

Set grid properties.

inline void setVisible(bool v, int index)

Set grid visibility in specified viewport.

Parameters:
  • v[in] - true / false: set visibility on / off

  • index[in] - viewport index

inline void setStep(real st)

Set object move step.

Parameters:

st[in] - object move step (in meters)

inline void setAngleStep(real st)

Set object rotation step.

Parameters:

st[in] - object rotation step (in degrees)

inline void setScaleStep(real st)

Set object scaling step.

Parameters:

st[in] - objects scaling step (in percent from original size)

void save(DataBlock &blk)

Save grid properties to blk file.

Parameters:

blk[in] - Data Block that contains data to save (see #DataBlock)

void load(const DataBlock &blk)

Load grid properties from blk file.

Parameters:

blk[in] - Data Block that contains data to load (see #DataBlock)

void render(Point3 *pt, Point3 *dirs, real zoom, int index, bool test_z = true, bool write_z = true)

Render the grid in specified viewport.

Parameters:
  • pt[in] - pointer to array of four Point3, specifying vertex coordinates of grid’s rectangle

  • dirs[in] - pointer to array of two Point3, specifyind grid`s lines directions

  • zoom[in] - viewport zoom

  • index[in] - viewport index

real snap(real f, real st) const

Round value to the nearest (snapped) value.

Parameters:
  • f[in] - the value to snap

  • st[in] - snap step

Returns:

the snapped value

Point3 snapToGrid(const Point3 &p) const

Snap to grid - round coordinates to the nearest grid’s point.

Parameters:

p[in] - point coordinates to snap

Returns:

coordinates of snapped point

Point3 snapToAngle(const Point3 &p) const

Snap to angle - round rotation angle to the nearest (snapped) angle

Parameters:

p[in] - angle to snap

Returns:

snapped angle

Point3 snapToScale(const Point3 &p) const

Snap to scale - round scale value to the nearest (snapped) value

Parameters:

p[in] - scale value to snap

Returns:

snapped scale value

Public Functions

GridObject()

Constructor.

~GridObject()
class IBrushClient
#include <ec_brush.h>

Interface class for receiving messages from Brush.

Public Functions

virtual void onBrushPaintStart(Brush *brush, int buttons, int key_modif) = 0

Informs client code about start of painting.

Parameters:
  • brush[in] - pointer to brush (see Brush)

  • buttons[in] - mouse buttons

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

virtual void onRBBrushPaintStart(Brush *brush, int buttons, int key_modif) = 0

Informs client code about start of painting by right mouse button.

Parameters:
  • brush[in] - pointer to brush (see Brush)

  • buttons[in] - mouse buttons

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

virtual void onBrushPaintEnd(Brush *brush, int buttons, int key_modif) = 0

Informs client code about end of painting.

Parameters:
  • brush[in] - pointer to brush (see Brush)

  • buttons[in] - mouse buttons

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

virtual void onRBBrushPaintEnd(Brush *brush, int buttons, int key_modif) = 0

Informs client code about end of painting by right mouse button.

Parameters:
  • brush[in] - pointer to brush (see Brush)

  • buttons[in] - mouse buttons

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

virtual void onBrushPaint(Brush *brush, const Point3 &center, const Point3 &prev_center, const Point3 &normal, int buttons, int key_modif) = 0

Informs client code about process of painting. Function is called either at the beginning of painting, when user moves mouse with left button pressed or periodically (if the brush is in repeat mode) while left mouse button is pressed.

Parameters:
  • brush[in] - pointer to brush (see Brush)

  • center[in] - world coordinates of brush center

  • prev_center[in] - world coordinates of brush center at previous call to onBrushPaint(). If onBrushPaint() is called after onBrushPaintStart() then center == prev_center.

  • normal[in] - surface normal at center point

  • buttons[in] - mouse buttons

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

virtual void onRBBrushPaint(Brush *brush, const Point3 &center, const Point3 &prev_center, const Point3 &normal, int buttons, int key_modif) = 0

Informs client code about process of painting. Function is called either at the beginning of painting, when user moves mouse with right button pressed or periodically (if the brush is in repeat mode) while left mouse button is pressed.

Parameters:
  • brush[in] - pointer to brush (see Brush)

  • center[in] - world coordinates of brush center

  • prev_center[in] - world coordinates of brush center at previous call to onRBBrushPaint(). If onRBBrushPaint() is called after onBrushPaintStart() then center == prev_center.

  • normal[in] - surface normal at center point

  • buttons[in] - mouse buttons

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

struct Icons

Public Functions

PropPanel::IconId getForType(int type) const
PropPanel::IconId getSelectionIcon(OutlinerSelectionState selection_state) const
PropPanel::IconId getVisibilityIcon(bool visible) const
PropPanel::IconId getLockIcon(bool locked) const

Public Members

PropPanel::IconId settings = PropPanel::IconId::Invalid
PropPanel::IconId settingsOpen = PropPanel::IconId::Invalid
PropPanel::IconId search = PropPanel::IconId::Invalid
PropPanel::IconId typeEntity = PropPanel::IconId::Invalid
PropPanel::IconId typeSpline = PropPanel::IconId::Invalid
PropPanel::IconId typePolygon = PropPanel::IconId::Invalid
PropPanel::IconId layerDefault = PropPanel::IconId::Invalid
PropPanel::IconId layerActive = PropPanel::IconId::Invalid
PropPanel::IconId layerActiveLocked = PropPanel::IconId::Invalid
PropPanel::IconId layerLocked = PropPanel::IconId::Invalid
PropPanel::IconId layerAdd = PropPanel::IconId::Invalid
PropPanel::IconId layerCreate = PropPanel::IconId::Invalid
PropPanel::IconId selectAll = PropPanel::IconId::Invalid
PropPanel::IconId selectPartial = PropPanel::IconId::Invalid
PropPanel::IconId selectNone = PropPanel::IconId::Invalid
PropPanel::IconId visibilityVisible = PropPanel::IconId::Invalid
PropPanel::IconId visibilityHidden = PropPanel::IconId::Invalid
PropPanel::IconId lockOpen = PropPanel::IconId::Invalid
PropPanel::IconId lockClosed = PropPanel::IconId::Invalid
PropPanel::IconId applyToMask = PropPanel::IconId::Invalid
PropPanel::IconId applyToMaskDisabled = PropPanel::IconId::Invalid
PropPanel::IconId exportLayer = PropPanel::IconId::Invalid
PropPanel::IconId exportLayerDisabled = PropPanel::IconId::Invalid
PropPanel::IconId alert = PropPanel::IconId::Invalid
PropPanel::IconId close = PropPanel::IconId::Invalid
class ICustomCameras
#include <ec_interface_ex.h>

Interface class for viewport to operate with custom cameras.

Public Functions

virtual int getSelectedCamera() = 0

Get current camera ID.

Returns:

current camera ID. If no such a camera the function must return -1

virtual bool getCamera(const int id, TMatrix &matrix, real &fov, String &name) = 0

Get camera properties.

Parameters:
  • id[in] - camera ID (menu ID of the camera)

  • matrix[out] - camera matrix

  • fov[out] - camera FOV (Field Of View)

  • name[out] - camera name

Returns:

true if operation successful, false in other case

virtual bool setCamera(const int id, const TMatrix &matrix) = 0

Set camera matrix.

Parameters:
  • id[in] - camera ID (menu ID of the camera)

  • matrix[in] - camera matrix

Returns:

true if operation successful, false in other case

class IDagorConsole
#include <ec_IEditorCore.h>

Public Functions

virtual void startProgress(CoolConsole &con) const = 0
virtual void endProgress(CoolConsole &con) const = 0
virtual void addMessageFmt(CoolConsole &con, ILogWriter::MessageType t, const char *msg, const DagorSafeArg *arg, int anum) const = 0
virtual void showConsole(CoolConsole &con, bool activate = false) const = 0
virtual void hideConsole(const CoolConsole &con) const = 0
virtual bool registerCommand(CoolConsole &con, const char *cmd, IConsoleCmd *handler) const = 0
virtual bool unregisterCommand(CoolConsole &con, const char *cmd, IConsoleCmd *handler) const = 0
class IDagorGeom
#include <ec_IEditorCore.h>

Public Functions

virtual StaticGeometryContainer *newStaticGeometryContainer(IMemAlloc *alloc = NULL) = 0
virtual void deleteStaticGeometryContainer(StaticGeometryContainer *&cont) = 0
virtual void staticGeometryContainerClear(StaticGeometryContainer &cont) = 0
virtual bool staticGeometryContainerLoadFromDag(StaticGeometryContainer &cont, const char *path, ILogWriter *log, bool use_not_found_tex = false, int load_flags = LASF_MATNAMES | LASF_NULLMATS) = 0
virtual bool staticGeometryContainerImportDag(StaticGeometryContainer &cont, const char *src, const char *dest) const = 0
virtual void staticGeometryContainerExportDag(StaticGeometryContainer &cont, const char *path, bool make_tex_path_local = true) const = 0
virtual GeomObject *newGeomObject(IMemAlloc *alloc = NULL) = 0
virtual void deleteGeomObject(GeomObject *&geom) = 0
virtual void geomObjectSaveToDag(GeomObject &go, const char *path) const = 0
virtual bool geomObjectLoadFromDag(GeomObject &go, const char *path, ILogWriter *log, ITextureNameResolver *resolv_cb = NULL) const = 0
virtual void geomObjectClear(GeomObject &go) const = 0
virtual void geomObjectEraseNode(GeomObject &go, int idx) const = 0
virtual StaticGeometryContainer &geomObjectGetGeometryContainer(GeomObject &go) const = 0
virtual const StaticGeometryContainer &geomObjectGetGeometryContainer(const GeomObject &go) const = 0
virtual void geomObjectSetDefNodeVis(GeomObject &go) = 0
virtual void geomObjectRecompile(GeomObject &go, const Bitarray *node_vis = NULL) = 0
virtual void geomObjectCreateFromGeomContainer(GeomObject &go, const StaticGeometryContainer &cont, bool do_recompile = true) = 0
virtual void geomObjectRender(GeomObject &go) = 0
virtual void geomObjectRenderColor(GeomObject &go, DynRenderBuffer *buffer, E3DCOLOR c, bool renderable_only = true) const = 0
virtual void geomObjectRenderNodeColor(GeomObject &go, int idx, DynRenderBuffer *buffer, E3DCOLOR c, bool renderable_only = true) const = 0
virtual void geomObjectRenderTrans(GeomObject &go) = 0
virtual void geomObjectRenderEdges(GeomObject &go, bool is_visible, E3DCOLOR color = E3DCOLOR(200, 200, 200, 200)) = 0
virtual BBox3 geomObjectGetBoundBox(GeomObject &go, bool local_coord = false) const = 0
virtual BBox3 geomObjectGetNodeBoundBox(const GeomObject &go, int idx, bool local_coord = false) const = 0
virtual const char *geomObjectGetShaderName(const GeomObject &go, int idx) const = 0
virtual ShaderMesh *geomObjectGetShaderMesh(const GeomObject &go, int idx) const = 0
virtual bool geomObjectShadowRayHitTest(GeomObject &go, const Point3 &p, const Point3 &dir, real maxt, int trace_flags = 0) const = 0
virtual bool geomObjectTraceRay(GeomObject &go, const Point3 &p, const Point3 &dir, real &maxt, Point3 *norm) const = 0
virtual bool geomObjectReloadRayTracer(GeomObject &go) const = 0
virtual StaticSceneRayTracer *geomObjectGetRayTracer(GeomObject &go) const = 0
virtual StaticGeometryNode *newStaticGeometryNode(IMemAlloc *alloc = NULL) = 0
virtual StaticGeometryNode *newStaticGeometryNode(const StaticGeometryNode &from, IMemAlloc *alloc = NULL) = 0
virtual void deleteStaticGeometryNode(StaticGeometryNode *&node) = 0
virtual bool staticGeometryNodeHaveBillboardMat(const StaticGeometryNode &node) const = 0
virtual void staticGeometryNodeCalcBoundBox(StaticGeometryNode &node) const = 0
virtual void staticGeometryNodeCalcBoundSphere(StaticGeometryNode &node) const = 0
virtual void staticGeometryNodeSetMaterialLighting(const StaticGeometryNode &node, StaticGeometryMaterial &mat) const = 0
virtual const char *staticGeometryNodeLightingToStr(StaticGeometryNode::Lighting light) const = 0
virtual StaticGeometryNode::Lighting staticGeometryNodeStrToLighting(const char *light) const = 0
virtual StaticGeometryMesh *newStaticGeometryMesh(IMemAlloc *alloc = NULL) const = 0
virtual void deleteStaticGeometryMesh(StaticGeometryMesh *&mesh) const = 0
virtual GeomResourcesHelper *newGeomResourcesHelper(IStaticGeomResourcesService *svc, IMemAlloc *alloc = NULL) const = 0
virtual void deleteGeomResourcesHelper(GeomResourcesHelper *&helper) const = 0
virtual void geomResourcesHelperSetResourcesService(GeomResourcesHelper &helper, IStaticGeomResourcesService *svc) const = 0
virtual void geomResourcesHelperCreateResources(GeomResourcesHelper &helper, const void *obj_id, const TMatrix &tm, const StaticGeometryContainer &cont, ILogWriter *log = NULL) const = 0
virtual void geomResourcesHelperFreeResources(GeomResourcesHelper &helper, const void *obj_id) const = 0
virtual void geomResourcesHelperSetResourcesTm(GeomResourcesHelper &helper, const void *obj_id, const TMatrix &tm) const = 0
virtual void geomResourcesHelperRemapResources(GeomResourcesHelper &helper, const void *obj_id_old, const void *obj_id_new) const = 0
virtual int geomResourcesHelperCompact(GeomResourcesHelper &helper) const = 0
virtual ShaderMaterial *newShaderMaterial(MaterialData &m) const = 0
virtual int getShaderVariableId(const char *name) const = 0
virtual const char *getShaderVariableName(int id) const = 0
virtual bool shaderGlobalSetInt(int id, int val) const = 0
virtual bool shaderGlobalSetReal(int id, real val) const = 0
virtual bool shaderGlobalSetColor4(int id, const Color4 &val) const = 0
virtual bool shaderGlobalSetTexture(int id, TEXTUREID val) const = 0
virtual bool shaderGlobalSetSampler(int id, d3d::SamplerHandle val) const = 0
virtual d3d::SamplerHandle getSeparateSampler(TEXTUREID val) const = 0
virtual int shaderGlobalGetInt(int id) const = 0
virtual real shaderGlobalGetReal(int id) const = 0
virtual Color4 shaderGlobalGetColor4(int id) const = 0
virtual TEXTUREID shaderGlobalGetTexture(int id) const = 0
virtual void shaderGlobalSetVarsFromBlk(const DataBlock &blk) const = 0
virtual int shaderGlobalGetBlockId(const char *name) const = 0
virtual void shaderGlobalSetBlock(int id, int layer = -1) const = 0
virtual void shaderElemInvalidateCachedStateBlock() const = 0
virtual shaders::OverrideStateId create(const shaders::OverrideState&) const = 0
virtual bool destroy(shaders::OverrideStateId &override_id) const = 0
virtual bool set(shaders::OverrideStateId override_id) const = 0
virtual bool reset_override() const = 0
virtual Mesh *newMesh(IMemAlloc *alloc = NULL) const = 0
virtual void deleteMesh(Mesh *&mesh) const = 0
virtual int meshOptimizeTverts(Mesh &mesh) const = 0
virtual int meshCalcNgr(Mesh &mesh) const = 0
virtual int meshCalcVertnorms(Mesh &mesh) const = 0
virtual void meshFlipNormals(Mesh &mesh, int f0 = 0, int nf = -1) const = 0
virtual PostFxRenderer *newPostFxRenderer() const = 0
virtual void deletePostFxRenderer(PostFxRenderer*&) const = 0
virtual void postFxRendererInit(PostFxRenderer &p, const char *shader_name) const = 0
virtual void postFxRendererRender(PostFxRenderer &p) const = 0
virtual bool generatePlane(const Point2 &cell_size, StaticGeometryContainer &geom) const = 0
virtual bool generatePlane(const Point2 &cell_size, StaticGeometryContainer &geom, StaticGeometryMaterial *material) const = 0
virtual bool generateBox(const IPoint3 &segments, StaticGeometryContainer &geom) const = 0
virtual bool generateCylinder(int sides, int height_segments, int cap_segments, StaticGeometryContainer &geom) const = 0
virtual bool generatePolyMesh(const Tab<Point2> &points, int height_segments, StaticGeometryContainer &geom) const = 0
virtual bool generateBoxSpiralStair(int steps, real w, real arc, StaticGeometryContainer &geom) const = 0
virtual bool generateClosedSpiralStair(int steps, real w, real arc, StaticGeometryContainer &geom) const = 0
virtual bool generateOpenSpiralStair(int steps, real w, real h, real arc, StaticGeometryContainer &geom) const = 0
virtual bool generateBoxStair(int steps, StaticGeometryContainer &geom) const = 0
virtual bool generateClosedStair(int steps, StaticGeometryContainer &geom) const = 0
virtual bool generateOpenStair(int steps, real h, StaticGeometryContainer &geom) const = 0
virtual bool objCreator3dAddNode(const char *name, Mesh *mesh, MaterialDataList *material, StaticGeometryContainer &geom) const = 0
virtual BoxCreator *newBoxCreator(IMemAlloc *alloc = NULL) const = 0
virtual void deleteBoxCreator(BoxCreator *&creator) const = 0
virtual SphereCreator *newSphereCreator(IMemAlloc *alloc = NULL) const = 0
virtual void deleteSphereCreator(SphereCreator *&creator) const = 0
virtual PlaneCreator *newPlaneCreator(IMemAlloc *alloc = NULL) const = 0
virtual void deletePlaneCreator(PlaneCreator *&creator) const = 0
virtual PointCreator *newPointCreator(IMemAlloc *alloc = NULL) const = 0
virtual void deletePointCreator(PointCreator *&creator) const = 0
virtual CylinderCreator *newCylinderCreator(IMemAlloc *alloc = NULL) const = 0
virtual void deleteCylinderCreator(CylinderCreator *&creator) const = 0
virtual PolyMeshCreator *newPolyMeshCreator(IMemAlloc *alloc = NULL) const = 0
virtual void deletePolyMeshCreator(PolyMeshCreator *&creator) const = 0
virtual StairCreator *newStairCreator(IMemAlloc *alloc = NULL) const = 0
virtual void deleteStairCreator(StairCreator *&creator) const = 0
virtual SpiralStairCreator *newSpiralStairCreator(IMemAlloc *alloc) const = 0
virtual void deleteSpiralStairCreator(SpiralStairCreator *&creator) const = 0
virtual SplineCreator *newSplineCreator(IMemAlloc *alloc) const = 0
virtual void deleteSplineCreator(SplineCreator *&creator) const = 0
virtual TargetCreator *newTargetCreator(IMemAlloc *alloc = NULL) const = 0
virtual void deleteTargetCreator(TargetCreator *&creator) const = 0
virtual PolygoneZoneCreator *newPolygonZoneCreator(IMemAlloc *alloc = NULL) const = 0
virtual void deletePolyZoneCreator(PolygoneZoneCreator *&creator) const = 0
virtual void deleteIObjectCreator(IObjectCreator *&creator) const = 0
virtual DagSaver *newDagSaver(IMemAlloc *alloc = NULL) const = 0
virtual void deleteDagSaver(DagSaver *&saver) const = 0
virtual bool dagSaverStartSaveDag(DagSaver &saver, const char *path) const = 0
virtual bool dagSaverEndSaveDag(DagSaver &saver) const = 0
virtual bool dagSaverStartSaveNodes(DagSaver &saver) const = 0
virtual bool dagSaverEndSaveNodes(DagSaver &saver) const = 0
virtual bool dagSaverStartSaveNode(DagSaver &saver, const char *name, const TMatrix &wtm, int flg = DAG_NF_RENDERABLE | DAG_NF_CASTSHADOW | DAG_NF_RCVSHADOW, int children = 0) const = 0
virtual bool dagSaverEndSaveNode(DagSaver &saver) const = 0
virtual bool dagSaverSaveDagSpline(DagSaver &saver, DagSpline **spline, int cnt) const = 0
virtual AScene *newAScene(IMemAlloc *alloc = NULL) const = 0
virtual void deleteAScene(AScene *&scene) const = 0
virtual int loadAscene(const char *fn, AScene &sc, int flg, bool fatal_on_error) const = 0
virtual void nodeCalcWtm(Node &node) const = 0
virtual bool nodeEnumNodes(Node &node, Node::NodeEnumCB &cb, Node **res = NULL) const = 0
class IDagorInput
#include <ec_IEditorCore.h>

Public Functions

virtual bool isKeyDown(ImGuiKey key) const = 0
virtual bool isAltKeyDown() const = 0
virtual bool isCtrlKeyDown() const = 0
virtual bool isShiftKeyDown() const = 0
class IDagorRender
#include <ec_IEditorCore.h>

Public Functions

virtual void fillD3dInterfaceTable(D3dInterfaceTable &d3dit) const = 0
virtual DagorCurView &curView() const = 0
virtual void startLinesRender(bool test_z = true, bool write_z = true, bool z_func_less = false) const = 0
virtual void setLinesTm(const TMatrix &tm) const = 0
virtual void endLinesRender() const = 0
virtual void renderLine(const Point3 &p0, const Point3 &p1, E3DCOLOR color) const = 0
virtual void renderLine(const Point3 *points, int count, E3DCOLOR color) const = 0
virtual void renderBox(const BBox3 &box, E3DCOLOR color) const = 0
virtual void renderBox(const Point3 &p, const Point3 &ax, const Point3 &ay, const Point3 &az, E3DCOLOR color) const = 0
virtual void renderSphere(const Point3 &center, real rad, E3DCOLOR col, int segs = 24) const = 0
virtual void renderCircle(const Point3 &center, const Point3 &ax1, const Point3 &ax2, real radius, E3DCOLOR col, int segs = 24) const = 0
virtual void renderXZCircle(const Point3 &center, real radius, E3DCOLOR col, int segs = 24) const = 0
virtual void renderCapsuleW(const Capsule &cap, E3DCOLOR c) const = 0
virtual void renderCylinder(const TMatrix &tm, float rad, float height, E3DCOLOR c) const = 0
virtual DebugPrimitivesVbuffer *newDebugPrimitivesVbuffer(const char *name, IMemAlloc *alloc = NULL) const = 0
virtual void deleteDebugPrimitivesVbuffer(DebugPrimitivesVbuffer *&vbuf) const = 0
virtual void beginDebugLinesCacheToVbuffer(DebugPrimitivesVbuffer &vbuf) const = 0
virtual void endDebugLinesCacheToVbuffer(DebugPrimitivesVbuffer &vbuf) const = 0
virtual void invalidateDebugPrimitivesVbuffer(DebugPrimitivesVbuffer &vbuf) const = 0
virtual void renderLinesFromVbuffer(DebugPrimitivesVbuffer &vbuf) const = 0
virtual void renderLinesFromVbuffer(DebugPrimitivesVbuffer &vbuf, E3DCOLOR c) const = 0
virtual void renderLinesFromVbuffer(DebugPrimitivesVbuffer &vbuf, bool z_test, bool z_write, bool z_func_less, Color4 color_multiplier) const = 0
virtual void addLineToVbuffer(DebugPrimitivesVbuffer &vbuf, const Point3 &p0, const Point3 &p1, E3DCOLOR c) const = 0
virtual void addHatchedBoxToVbuffer(DebugPrimitivesVbuffer &vbuf, const TMatrix &box_tm, float hatching_step, E3DCOLOR color) const = 0
virtual void addBoxToVbuffer(DebugPrimitivesVbuffer &vbuf, const Point3 &p, const Point3 &ax, const Point3 &ay, const Point3 &az, E3DCOLOR color) const = 0
virtual void addSolidBoxToVbuffer(DebugPrimitivesVbuffer &vbuf, const Point3 &p, const Point3 &ax, const Point3 &ay, const Point3 &az, E3DCOLOR color) const = 0
virtual void addBoxToVbuffer(DebugPrimitivesVbuffer &vbuf, const BBox3 &box, E3DCOLOR color) const = 0
virtual void addTriangleToVbuffer(DebugPrimitivesVbuffer &vbuf, const Point3 p[3], E3DCOLOR color) const = 0
virtual bool isLinesVbufferValid(DebugPrimitivesVbuffer &vbuf) const = 0
virtual void setVbufferTm(DebugPrimitivesVbuffer &vbuf, const TMatrix &tm) const = 0
virtual DynamicShadersBuffer *newDynamicShadersBuffer(IMemAlloc *alloc = NULL) const = 0
virtual DynamicShadersBuffer *newDynamicShadersBuffer(CompiledShaderChannelId *channels, int channel_count, int max_verts, int max_faces, IMemAlloc *alloc = NULL) const = 0
virtual void deleteDynamicShadersBuffer(DynamicShadersBuffer *&buf) const = 0
virtual void dynShaderBufferSetCurrentShader(DynamicShadersBuffer &buf, ShaderElement *shader) const = 0
virtual void dynShaderBufferAddFaces(DynamicShadersBuffer &buf, const void *vertex_data, int num_verts, const int *indices, int num_faces) const = 0
virtual void dynShaderBufferFlush(DynamicShadersBuffer &buf) const = 0
virtual DynRenderBuffer *newDynRenderBuffer(const char *class_name, IMemAlloc *alloc) const = 0
virtual void deleteDynRenderBuffer(DynRenderBuffer *&buf) const = 0
virtual void dynRenderBufferClearBuf(DynRenderBuffer &buf) const = 0
virtual void dynRenderBufferFlush(DynRenderBuffer &buf) const = 0
virtual void dynRenderBufferFlushToBuffer(DynRenderBuffer &buf, TEXTUREID tid) const = 0
virtual void dynRenderBufferDrawQuad(DynRenderBuffer &buf, const Point3 &p0, const Point3 &p1, const Point3 &p2, const Point3 &p3, E3DCOLOR color, float u = 1, float v = 1) const = 0
virtual void dynRenderBufferDrawLine(DynRenderBuffer &buf, const Point3 &from, const Point3 &to, real width, E3DCOLOR color) const = 0
virtual void dynRenderBufferDrawSquare(DynRenderBuffer &buf, const Point3 &p, real radius, E3DCOLOR color) const = 0
virtual void dynRenderBufferDrawBox(DynRenderBuffer &buf, const TMatrix &tm, E3DCOLOR color) const = 0
virtual void *dynRenderBufferDrawNetSurface(DynRenderBuffer &buf, int w, int h) const = 0
virtual TEXTUREID addManagedTexture(const char *name) const = 0
virtual TEXTUREID registerManagedTex(const char *name, BaseTexture *basetex) const = 0
virtual BaseTexture *acquireManagedTex(TEXTUREID id) const = 0
virtual void releaseManagedTex(TEXTUREID id) const = 0
virtual void releaseManagedResVerified(TEXTUREID &id, D3dResource *cmp) const
template<class T>
inline void releaseManagedTexVerified(D3DRESID &id, T &tex)
virtual E3DCOLOR normalizeColor4(const Color4 &color, real &bright) const = 0
virtual int getHdrMode() const = 0
virtual void renderTextFmt(real x, real y, E3DCOLOR color, const char *format, const DagorSafeArg *arg, int anum) const = 0
virtual BBox2 getTextBBox(const char *str, int len = -1) const = 0
virtual int setTextFont(int font_id, int font_kern = 0) const = 0
virtual void getFontAscentAndDescent(int &ascent, int &descent) const = 0
virtual void drawSolidRectangle(real left, real top, real right, real bottom, E3DCOLOR color) const
class IDagorScene
#include <ec_IEditorCore.h>

Public Functions

virtual int staticSceneRayTracerTraceRay(StaticSceneRayTracer &rt, const Point3 &p, const Point3 &wdir2, real &mint2, int from_face = -1) const = 0
virtual int fastRtDumpTraceRay(FastRtDump &frt, int custom, const Point3 &p, const Point3 &dir, real &t, int &out_pmid) const = 0
virtual BuildableStaticSceneRayTracer *createBuildableStaticmeshsceneRaytracer(const Point3 &lsz, int lev) const = 0
virtual bool buildableStaticSceneRayTracerAddmesh(BuildableStaticSceneRayTracer &rt, const Point3 *vert, int vcount, const unsigned *face, unsigned stride, int fn, const unsigned *face_flags, bool rebuild = true) const = 0
virtual bool buildableStaticSceneRayTracerReserve(BuildableStaticSceneRayTracer &rt, int face_count, int vert_count) const = 0
virtual bool buildableStaticSceneRayTracerRebuild(BuildableStaticSceneRayTracer &rt) const = 0
virtual StaticSceneBuilder::StdTonemapper *newStdTonemapper(IMemAlloc *alloc = NULL) const = 0
virtual StaticSceneBuilder::StdTonemapper *newStdTonemapper(const StaticSceneBuilder::StdTonemapper &from, IMemAlloc *alloc = NULL) const = 0
virtual void deleteStdTonemapper(StaticSceneBuilder::StdTonemapper *&mapper) const = 0
virtual void stdTonemapperRecalc(StaticSceneBuilder::StdTonemapper &mapper) const = 0
virtual void stdTonemapperSave(StaticSceneBuilder::StdTonemapper &mapper, DataBlock &blk) const = 0
virtual void stdTonemapperLoad(StaticSceneBuilder::StdTonemapper &mapper, const DataBlock &blk) const = 0
virtual GameResource *getGameResource(GameResHandle handle, bool no_factory_fatal = true) const = 0
virtual void releaseGameResource(GameResource *resource) const = 0
class IDagorTools
#include <ec_IEditorCore.h>

Public Functions

virtual bool ddsConvertImage(ddstexture::Converter &converter, IGenSave &cb, TexPixel32 *pixels, int width, int height, int stride) const = 0
virtual bool loadmaskloadMaskFromFile(const char *filename, SmallTab<float, TmpmemAlloc> &hmap, int &w, int &h) const = 0
virtual AnimV20::AnimData *newAnimData(IMemAlloc *alloc = NULL) const = 0
virtual bool animDataLoad(AnimV20::AnimData &anim, IGenLoad &cb, IMemAlloc *alloc = midmem) const = 0
virtual unsigned getSimpleHash(const char *s, unsigned int init_val) const = 0
virtual void *win32GetMainWnd() const = 0
virtual int getTimeMsec() const = 0
virtual __int64 refTimeUsec() const = 0
virtual void ddsxShutdownPlugins() = 0
virtual bool ddsxConvertDds(unsigned targ_code, ddsx::Buffer &dest, void *dds_data, int dds_len, const ddsx::ConvertParams &p) = 0
virtual const char *ddsxGetLastErrorText() = 0
virtual void ddsxFreeBuffer(ddsx::Buffer &b) = 0
virtual bool copyFile(const char *src, const char *dest, bool overwrite = true) const = 0
virtual bool compareFile(const char *path1, const char *path2) const = 0
class IEditorCore
#include <ec_IEditorCore.h>

Public Functions

virtual IDagorRender *getRender() = 0
virtual IDagorGeom *getGeom() = 0
virtual IDagorConsole *getConsole() = 0
virtual IDagorInput *getInput() = 0
virtual IDagorTools *getTools() = 0
virtual IDagorScene *getScene() = 0
virtual const char *getExePath() = 0

Public Static Functions

static IEditorCore &make_instance()
class IEditorCoreEngine
#include <ec_interface.h>

Interface class to editor core. Used to call core functions. Editor interface to be used by plugins.

Gizmo enums.

enum ModeType

Gizmo modes.

Values:

enumerator MODE_None

No Gizmo modes selected.

enumerator MODE_Move

Gizmo is in ‘Move’ mode.

enumerator MODE_Scale

Gizmo is in ‘Scale’ mode.

enumerator MODE_Rotate

Gizmo is in ‘Rotate’ mode.

enumerator MODE_MoveSurface

Gizmo is in ‘Move on surface’ mode.

enum BasisType

Gizmo basis.

Values:

enumerator BASIS_None

No Gizmo basis.

enumerator BASIS_World

Gizmo has ‘World’ basis.

enumerator BASIS_Local

Gizmo has ‘Local’ basis.

enumerator BASIS_Parent

Gizmo has ‘Parent’ basis.

Gizmo bit masks.

Values:

enumerator GIZMO_MASK_Mode

Mask for getting Gizmo mode (see ModeType).

enumerator GIZMO_MASK_Basis

Mask for getting type of Gizmo basis (see BasisType).

enumerator GIZMO_MASK_CENTER

Mask for getting type of Gizmo center (see CenterType).

enum CenterType

Gizmo center types.

Values:

enumerator CENTER_None

No Gizmo center type.

enumerator CENTER_Pivot

Gizmo has ‘Pivot’ center type. Gizmo center is coincides with center of first selected object.

enumerator CENTER_Selection

Gizmo has ‘Selection’ center type. Gizmo center is in geometric center of selected objects.

enumerator CENTER_Coordinates

Gizmo is set in center of world coordinates (0,0,0)

enumerator CENTER_SelectionNotRotObj

Gizmo not rotates objects in group of selected objects.

enum ViewportCacheMode

Viewport cache modes.

Values:

enumerator VCM_NoCacheAll

Cache disabled.

enumerator VCM_CacheAll

Cache all viewports.

enumerator VCM_CacheAllButActive

Cache all viewports except active one.

inline IEditorCoreEngine()

Constructor.

inline bool checkVersion()

Interface version check.

Returns:

true if version check successful, false in other case

Internal interface (NOT TO BE USED BY PLUGINS!).

int interfaceVer
static IEditorCoreEngine *__global_instance
virtual void actObjects(real dt) = 0

Objects in ‘Animation’ stage

Parameters:

dt – -

virtual void beforeRenderObjects() = 0

Objects in ‘before Render’ stage.

virtual void renderObjects() = 0

Objects in ‘Render’ stage.

virtual void renderIslDecalObjects() = 0
virtual void renderTransObjects() = 0

Transparent objects in ‘Render’ stage.

virtual Point3 snapToGrid(const Point3 &p) const = 0

Snap functions.

virtual Point3 snapToAngle(const Point3 &p) const = 0
virtual Point3 snapToScale(const Point3 &p) const = 0
virtual void *queryEditorInterfacePtr(unsigned huid) = 0
template<class T>
inline T *queryEditorInterface()
template<class T>
inline T *getInterfaceEx()
template<class T>
inline void getInterfacesEx(Tab<T*> &tab)
virtual const char *getLibDir() const = 0
virtual class LibCache *getLibCachePtr() = 0
virtual Tab<struct WspLibData> *getLibData() = 0
virtual void setColliders(dag::ConstSpan<IDagorEdCustomCollider*> c, unsigned filter_mask) const = 0
virtual void restoreEditorColliders() const = 0
virtual float getMaxTraceDistance() const = 0
virtual const EditorWorkspace &getBaseWorkspace() = 0
virtual void setShowMessageAt(int x, int y, const SimpleString &msg) = 0
virtual void showMessageAt() = 0

Register / unregister Plugin.

virtual bool registerPlugin(IGenEditorPlugin *plugin) = 0

Every plugin should be registered once.

Register plugin (every plugin should be registered once).

Parameters:

plugin[in] - pointer to plugin

Returns:

true if register successful, false in other case

virtual bool unregisterPlugin(IGenEditorPlugin *plugin) = 0

Unregister plugin

Parameters:

plugin[in] - pointer to plugin

Returns:

true if unregister successful, false in other case

Plugins management.

virtual int getPluginCount() = 0

Get a number of registered plugins.

Returns:

number of registered plugins

virtual IGenEditorPlugin *getPlugin(int idx) = 0

Get a pointer to plugin by index.

Parameters:

idx[in] - index in plugins array

Returns:

pointer to plugin

virtual IGenEditorPluginBase *getPluginBase(int idx) = 0
virtual IGenEditorPlugin *curPlugin() = 0

Get a pointer to current (active) plugin.

Returns:

pointer to current plugin

virtual IGenEditorPluginBase *curPluginBase() = 0
virtual void *getInterface(int interface_uid) = 0

Get a pointer to the desired interface.

virtual void getInterfaces(int interface_uid, Tab<void*> &interfaces) = 0

Get a set of pointers to the desired interface.

UI management

virtual IWndManager *getWndManager() const = 0

Get pointer to the window manager.

virtual PropPanel::ContainerPropertyControl *getCustomPanel(int id) const = 0

Get custom panel (property/toolbar/etc)

virtual void addPropPanel(int type, hdpi::Px width) = 0

Create new property panel.

virtual void removePropPanel(void *hwnd) = 0
virtual void managePropPanels() = 0
virtual void skipManagePropPanels(bool skip) = 0
virtual PropPanel::PanelWindowPropertyControl *createPropPanel(PropPanel::ControlEventHandler *eh, const char *caption) = 0
virtual PropPanel::IMenu *getMainMenu() = 0
virtual void deleteCustomPanel(PropPanel::ContainerPropertyControl *panel) = 0

Delete custom panel.

virtual PropPanel::DialogWindow *createDialog(hdpi::Px w, hdpi::Px h, const char *title) = 0

Create dialog with property panel.

virtual void deleteDialog(PropPanel::DialogWindow *dlg) = 0

Delete dialog.

Viewport methods.

virtual void updateViewports() = 0

Inform editor that viewports need redraw. Usually used before invalidateViewportCache().

virtual void invalidateViewportCache() = 0

Immediately redraw viewports. Usually used after updateViewports().

virtual void setViewportCacheMode(ViewportCacheMode mode) = 0

Set viewport cache mode.

Parameters:

mode[in] - viewport cache mode (see ViewportCacheMode)

virtual int getViewportCount() = 0

Get number of viewports.

Returns:

number of viewports

virtual IGenViewportWnd *getViewport(int n) = 0

Get a pointer to viewport by index.

Parameters:

n[in] - viewport index

Returns:

pointer to viewport

virtual IGenViewportWnd *getRenderViewport() = 0

Get a pointer to viewport that is rendering now. Used in plugins during a rendering stage.

Returns:

pointer to rendering viewport

virtual IGenViewportWnd *getCurrentViewport() = 0

Get a pointer to the last active viewport.

Returns:

- pointer to the last active viewport

-

NULL if no viewports were active yet

virtual void setViewportZnearZfar(real zn, real zf) = 0

Set visibility bounds (z-near, z-far) in all viewports.

Parameters:
  • zn[in] - z-near, a distance to nearest visible parts of scene (all parts more close to camera will be invisible)

  • zf[in] - z-far, a distance to the farthest visible parts of scene (all parts more distant from camera will be invisible)

Ray tracing methods.

virtual IGenViewportWnd *screenToViewport(int &x, int &y) = 0

Convert screen coordinates to coordinates of one of viewports.

Parameters:
  • x, y[in] - x,y screen coordinates

  • x, y[out] - x,y viewport coordinates

Returns:

pointer to viewport where output coordinates reside or NULL

virtual bool screenToWorldTrace(int x, int y, Point3 &world, real maxdist = 1000, Point3 *out_norm = NULL) = 0

Do a ray tracing from screen point to world point.

Parameters:
  • x, y[in] - x, y screen coordinates

  • world[out] - world coordinates

  • maxdist[in] - max distance of ray tracing. If max distance achieved and intersection with clipping surface not occurred function returns false.

  • out_norm[out] - surface normal in world point, NULL allowed.

Returns:

true if intersection with clipping surface occurred, false in other case

virtual bool clientToWorldTrace(IGenViewportWnd *wnd, int x, int y, Point3 &world, real maxdist = 1000, Point3 *out_norm = NULL) = 0

Do a ray tracing from viewport point to world point.

Parameters:
  • wnd[in] - pointer to viewport

  • x, y[in] - x, y viewport coordinates

  • world[out] - world coordinates

  • maxdist[in] - max distance of ray tracing. If max distance achieved and intersection with clipping surface not occurred function returns false.

  • out_norm[out] - surface normal in world point, NULL allowed.

Returns:

true if intersection with clipping surface occurred, false in other case

virtual void setupColliderParams(int mode, const BBox3 &area) = 0

Setup collider params for ray tracing

Parameters:
  • mode[in] - mode of ray tracing

  • area[in] - area to prepare

virtual bool traceRay(const Point3 &src, const Point3 &dir, real &dist, Point3 *out_norm = NULL, bool use_zero_plane = true) = 0

Do a ray tracing from world point to a given direction.

Parameters:
  • src[in] - start point of ray tracing

  • dir[in] - ray tracing direction

  • dist[in] - max distance of ray tracing

  • dist[out] - the distance from start point to clipping point

  • out_norm[out] - surface normal in clipping point, NULL allowed.

  • use_zero_plane[in] - trace to zero plane if no other collision occurred.

Returns:

true if intersection with collision surface occurred, false in other case

inline virtual real clipCapsuleStatic(const Capsule &c, Point3 &cap_pt, Point3 &world_pt)

Get intersection of the capsule and the collision surface.

Parameters:
  • c[in] - reference to the capsule

  • cap_pt[out] - capsule point that is placed most deeply behind collision surface

  • world_pt[out] - point of collision surface that is placed most deeply inside capsule

Returns:

distance between cap_pt and world_pt. If capsule not intersects collision surface the function returns 0

virtual bool getSelectionBox(BBox3 &box) = 0

Get current selection box. Selection box depends on plugin active and objects selected.

Parameters:

box[out] - selection box

Returns:

true if operation successful, false in other case

virtual void zoomAndCenter() = 0

Zoom and center objects.

Gizmo methods.

virtual void setGizmo(IGizmoClient *gc, ModeType type) = 0

Set Gizmo.

Parameters:
  • gc[in] - pointer to object of an interface class IGizmoClient

  • type[in] - Gizmo type and mode

virtual void startGizmo(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) = 0

Force start of changing objects with Gizmo, as if user clicks Gizmo. Function calls handleMouseLBPress() method of Gizmo’s event handler

Parameters:
  • wnd[in] - pointer to viewport window

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event successfully processed, false in other case

virtual void endGizmo(bool apply) = 0

End the currently onging gizmo operation the same way as if the user finished it by releasing the left mouse button or canceled it by pressing the right mouse button.

Parameters:

apply[in] - whether the apply or cancel the onging operation

virtual ModeType getGizmoModeType() = 0

Get Gizmo mode.

Returns:

Gizmo mode (see ModeType)

virtual BasisType getGizmoBasisType() = 0

Get Gizmo basis.

Returns:

Gizmo basis (see BasisType)

virtual BasisType getGizmoBasisTypeForMode(ModeType tp) = 0

Get Gizmo basis for a specific mode.

Returns:

Gizmo basis for a specific mode (see BasisType and see ModeType)

virtual CenterType getGizmoCenterType() = 0

Get Gizmo center type.

Returns:

Gizmo center type (see CenterType)

virtual CenterType getGizmoCenterTypeForMode(ModeType tp) = 0

Get Gizmo center type for a specific mode.

Returns:

Gizmo center type a specific mode (see CenterType and see ModeType)

virtual bool isGizmoOperationStarted() const = 0

Tests whether a gizmo operation is in progress. (For example pressing the left mouse button on the translation gizmo and moving an object.)

Returns:

true if operation is in progress

Brush methods.

virtual void beginBrushPaint() = 0

Force the core to begin working with brush.

virtual void renderBrush() = 0

Force the core to render brush.

virtual void setBrush(Brush *brush) = 0

Set brush.

Parameters:

brush[in] - pointer to brush

virtual Brush *getBrush() const = 0

Get current brush.

Returns:

brush - pointer to Brush

virtual void endBrushPaint() = 0

Stop working with brush.

virtual bool isBrushPainting() const = 0

Is working with brush.

Spatial cursor handling.

virtual void showUiCursor(bool vis) = 0

Show / hide spatial cursor.

Parameters:

vis[in] - true / false: show / hide

virtual void setUiCursorPos(const Point3 &pos, const Point3 *norm = NULL) = 0

Set spatial cursor position.

Parameters:
  • pos[in] - world coordinates

  • norm[in] - pointer to surface normal (if NULL then surface normal to be considered as Point3(0, 1, 0))

virtual void getUiCursorPos(Point3 &pos, Point3 &norm) = 0

Get spatial cursor position and surface normal.

Parameters:
  • pos[out] - world coordinates

  • norm[out] - surface normal

virtual void setUiCursorTex(TEXTUREID tex_id) = 0

Set spatial cursor texture.

Parameters:

tex_id[in] - texture’s id

virtual void setUiCursorProps(real size, bool always_xz) = 0

Set spatial cursor properties.

Parameters:
  • size[in] - size (in metres)

  • always_xz[in] - true - UI cursor surface always lies on XZ surface

virtual void showSelectWindow(IObjectsList *obj_list, const char *obj_list_owner_name = NULL) = 0

Show dialog window ‘Select by name’.

Parameters:

obj_list[in] - pointer to objects list (see IObjectsList)

virtual UndoSystem *getUndoSystem() = 0

Get pointer to editor’s render buffer.

Returns:

pointer to editor’s render buffer Get pointer to editor’s undo system.

Returns:

pointer to editor’s undo system

virtual CoolConsole &getConsole() = 0

Returns link to the application console.

virtual GridObject &getGrid() = 0

Get Grid object.

Returns:

reference to grid

virtual GizmoEventFilter &getGizmoEventFilter() = 0

Get gizmo event filter.

Returns:

reference to gizmo event filter

static inline IEditorCoreEngine *get()

Get pointer to current editor core instance.

Returns:

pointer to current editor core instance

static inline void set(IEditorCoreEngine *eng)

Set current editor core instance.

Parameters:

eng[in] - editor core instance

Public Static Attributes

static const int VERSION = 0x203

Current version of interface.

class IEnvironmentSettings
#include <ec_interface_ex.h>

Public Functions

virtual void getEnvironmentSettings(DataBlock &blk) = 0
virtual void setEnvironmentSettings(DataBlock &blk) = 0

Public Static Attributes

static constexpr unsigned HUID = 0x62B95DA4u
class IGenEditorPluginBase
#include <ec_interface.h>

Public Functions

inline virtual ~IGenEditorPluginBase()
inline virtual bool getVisible() const
virtual void *queryInterfacePtr(unsigned huid) = 0
template<class T>
inline T *queryInterface()
class IGenEventHandler
#include <ec_interface.h>

General event handler interface. Usually used to send messages from EditorCore to plugins. By using this interface plugins get to know about current events in Dagor Editor.

Subclassed by BrushEventFilter, GenericEditorAppWindow::AppEventHandler, GizmoEventFilter, IGenEventHandlerWrapper, ObjectEditor

Mouse events handlers.

virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) = 0

Handle mouse move.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) = 0

Handle mouse left button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) = 0

Handle mouse left button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) = 0

Handle mouse right button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseRBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) = 0

Handle mouse right button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseCBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) = 0

Handle mouse center button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseCBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) = 0

Handle mouse center button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseWheel(IGenViewportWnd *wnd, int wheel_d, int x, int y, int key_modif) = 0

Handle mouse scroll wheel

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • wheel_d[in] - scroll wheel steps

  • x, y[in] - x,y coordinates inside viewport

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseDoubleClick(IGenViewportWnd *wnd, int x, int y, int key_modif) = 0

Handle mouse double-click

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

Viewport redraw/change events handlers.

virtual void handleViewportPaint(IGenViewportWnd *wnd) = 0

Viewport CTL window redraw

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • dc[in] - viewport’s device context

virtual void handleViewChange(IGenViewportWnd *wnd) = 0

Viewport view change notification

Parameters:

wnd[in] - pointer to viewport window that generated the message

virtual ~IGenEventHandler() = default
class IGenEventHandlerWrapper : public IGenEventHandler
#include <ec_interface_ex.h>

Wrapper for IGenEventHandler. The class is intended for simplification of event handling in IGenEventHandler. Inheriting from this class one may override not all but wanted functions of IGenEventHandler only. Other events will be skipped or handled by event handler obtained by getWrappedHandler().

Mouse events handlers.

inline virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handles mouse move. If getWrappedHandler() returns not NULL then corresponding method (getWrappedHandler()->handleMouseMove()) will be called. In other case the function returns false.

Handle mouse move.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handles mouse left button press. If getWrappedHandler() returns not NULL then corresponding method (getWrappedHandler()->handleMouseLBPress()) will be called. In other case the function returns false.

Handle mouse left button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handles mouse left button release. If getWrappedHandler() returns not NULL then corresponding method (getWrappedHandler()->handleMouseLBRelease()) will be called. In other case the function returns false.

Handle mouse left button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handles mouse right button press. If getWrappedHandler() returns not NULL then corresponding method (getWrappedHandler()->handleMouseRBPress()) will be called. In other case the function returns false.

Handle mouse right button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseRBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handles mouse right button release. If getWrappedHandler() returns not NULL then corresponding method (getWrappedHandler()->handleMouseRBRelease()) will be called. In other case the function returns false.

Handle mouse right button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseCBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handles mouse center button press. If getWrappedHandler() returns not NULL then corresponding method (getWrappedHandler()->handleMouseCBPress()) will be called. In other case the function returns false.

Handle mouse center button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseCBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handles mouse center button release. If getWrappedHandler() returns not NULL then corresponding method (getWrappedHandler()->handleMouseCBRelease()) will be called. In other case the function returns false.

Handle mouse center button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseWheel(IGenViewportWnd *wnd, int wheel_d, int x, int y, int key_modif) override

Handles mouse scroll wheel. If getWrappedHandler() returns not NULL then corresponding method (getWrappedHandler()->handleMouseWheel()) will be called. In other case the function returns false.

Handle mouse scroll wheel

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • wheel_d[in] - scroll wheel steps

  • x, y[in] - x,y coordinates inside viewport

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseDoubleClick(IGenViewportWnd *wnd, int x, int y, int key_modif) override

Handles mouse double-click. If getWrappedHandler() returns not NULL then corresponding method (getWrappedHandler()->handleMouseDoubleClick()) will be called. In other case the function returns false.

Handle mouse double-click

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

Viewport redraw/change events handlers.

inline virtual void handleViewportPaint(IGenViewportWnd *wnd) override

Viewport CTL window redraw. If getWrappedHandler() returns not NULL then corresponding method (getWrappedHandler()->handleViewportPaint()) will be called. In other case the function does nothing.

Viewport CTL window redraw

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • dc[in] - viewport’s device context

inline virtual void handleViewChange(IGenViewportWnd *wnd) override

Viewport view change notification. If getWrappedHandler() returns not NULL then corresponding method (getWrappedHandler()->handleViewChange()) will be called. In other case the function does nothing.

Viewport view change notification

Parameters:

wnd[in] - pointer to viewport window that generated the message

Public Functions

virtual IGenEventHandler *getWrappedHandler() = 0

Get wrapped handler. Get pointer to default event handler.

Returns:

pointer to default event handler

class IGenViewportWnd
#include <ec_interface.h>

General viewport window interface. Used to interact with viewport window.

Subclassed by ViewportWindow

Methods to set / get viewport parameters.

virtual void setProjection(bool orthogonal, real fov, real near_plane, real far_plane) = 0

Set viewport projection parameters

Parameters:
  • orthogonal[in] - if true the view will be orthogonal, if false - perspective

  • fov[in] - camera’s Field Of View

  • near_plane[in] - z-near, a distance to nearest visible parts of scene (all parts more close to camera will be invisible)

  • far_plane[in] - z-far, a distance to the farthest visible parts of scene (all parts more distant from camera will be invisible)

virtual void getZnearZfar(real &zn, real &zf) const = 0
virtual void setFov(real fov) = 0

Set camera’s FOV (Field Of View).

Parameters:

fov[in] - camera’s angle of view (in radians)

virtual real getFov() = 0

Get camera’s FOV (Field Of View).

Returns:

fov (in radians)

virtual void setCameraDirection(const Point3 &forward, const Point3 &up) = 0

Set camera’s direction.

Parameters:
  • forward[in] - direction of camera’s view

  • up[in] - direction of camera’s top

virtual void setCameraMode(bool camera_mode) = 0

Set camera’s mode (orthogonal/perspective).

Parameters:

camera_mode[in] - if true the view will be orthogonal, if false - perspective

virtual void setCameraViewProjection(const TMatrix &view, real fov) = 0

Set camera’s projection.

Parameters:
  • view[in] - view matrix

  • fov[in] - camera’s Field Of View

virtual void setCameraPos(const Point3 &pos) = 0

Set camera’s position.

Parameters:

pos[in] - position

virtual void setCameraTransform(const TMatrix &tm) = 0

Set view matrix of the camera.

Parameters:

tm[in] - view matrix

virtual void setOrthogonalZoom(real zoom) = 0

Set zoom property for camera in orthogonal mode.

Parameters:

zoom[in] - zoom value

virtual void getCameraTransform(TMatrix &m) const = 0

Get view matrix of the camera.

Parameters:

m[out] - view matrix

virtual real getOrthogonalZoom() const = 0

Get zoom property for camera in orthogonal mode.

Returns:

zoom value

virtual bool isOrthogonal() const = 0

Test whether camera is in orthogonal mode

Returns:

true if viewport is in orthogonal mode, false in other case

virtual bool isFlyMode() const = 0

Test whether viewport is in “fly” mode

Returns:

true if viewport is in “fly” mode, false in other case

virtual void switchCamera(unsigned int from, unsigned int to) = 0

Switch view of camera from view 1 to view 2. For example, switch camera from “Left” view to “Top” view

Parameters:
  • from[in] - “from” view

  • to[in] - “to” view

Methods to convert viewport coordinates from one coordinate system

to another.

virtual void clientToWorld(const Point2 &screen, Point3 &world, Point3 &world_dir) = 0

Convert viewport screen coordinates to world coordinates.

Parameters:
  • screen[in] - screen coordinates

  • world[out] - world coordinates (on camera’s (lens’s) surface)

  • world_dir[out] - camera’s direction

virtual void worldToNDC(const Point3 &world, Point3 &ndc) const = 0

Convert viewport world coordinates to normal device coordinates.

Parameters:
  • world[in] - world coordinates

  • ndc[out] - normal device coordinates

virtual bool worldToClient(const Point3 &world, Point2 &screen, real *screen_z = NULL) = 0

Convert viewport world coordinates to screen coordinates.

Parameters:
  • world[in] - world coordinates

  • screen[out] - screen coordinates

  • screen_z[out]

    - the distance between camera and the world point,

    may be <0 if the world point is placed behind camera

Returns:

true if convertion successful, false in other case

virtual void clientToScreen(int &x, int &y) = 0

Convert viewport screen coordinates to application window screen coordinates.

Parameters:

x, y[inout] - x, y screen coordinates

virtual void screenToClient(int &x, int &y) = 0

Convert application window screen coordinates to viewport screen coordinates.

Parameters:

x, y[inout] - x, y screen coordinates

virtual void getViewportSize(int &x, int &y) = 0

Get dimensions of viewport in pixels

Parameters:

x, y[out] - x, y dimensions of viewport

virtual void zoomAndCenter(BBox3 &box) = 0

Set camera so that object bounding box will be centered and zoomed in viewport window.

Parameters:

box[inout] - object bounding box

Viewport activity.

virtual bool isActive() = 0

Test whether viewport is active.

Returns:

true if viewport is active, false in other case

virtual void activate() = 0

Activate viewport.

virtual real getLinearSizeSq(const Point3 &pos, real world_rad, int xy) = 0

Get square of visible radius of a circle.

Parameters:
  • pos[in] - world coordinates of center of a circle

  • world_rad[in] - radius of a circle

  • xy[in] - 0-horizontal radius, 1-vertical radius (of ellipse)

Returns:

square of visible radius of a circle (ellipse)

Viewport redraw methods.

virtual void redrawClientRect() = 0

Redraw viewport as Dagor Engine object and CTL object.

virtual void invalidateCache() = 0

Redraw viewport.

virtual void enableCache(bool en) = 0

Enable / disable viewport cache.

Parameters:

en[in] - true to enable cache, false to disable

virtual void setViewProj() = 0

Set parameters (projection matrix, etc) of a videocard driver camera

equal to parameters of viewport camera

Start / stop drawing rectangular selection box.

User interface for editing

virtual void startRectangularSelection(int mx, int my, int type) = 0

Start drawing rectangular selection box.

Parameters:
  • mx, my[in] - starting point of selection box

  • type[in] - type of selection box

virtual bool endRectangularSelection(EcRect *result, int *type) = 0

End drawing rectangular selection box.

Parameters:
  • result[out] - pointer to CtlRect with coordinates of a selected area (upper left and lower bottom corners of area). May be NULL

  • type[out] - type of selection box

Returns:

true if selection successful, false if selection aborted

virtual void drawText(int x, int y, const String &text) = 0

Draw statistics/debug texts in the viewport area.

Parameters:
  • x – - the horizontal viewport draw coordinate.

  • y – - the vertical viewport draw coordinate.

  • text – - the statistics/debug text to draw.

virtual void captureMouse() = 0
virtual void releaseMouse() = 0
virtual void setMenuEventHandler(PropPanel::IMenuEventHandler *meh) = 0

Sets a custom menu event handler for the custom context menu of the viewport.

virtual PropPanel::IMenu *getContextMenu() = 0

Retrieves the custom context menu of the viewport if it’s active/open.

virtual void setScreenshotMode(Point2 size) = 0
virtual void resetScreenshotMode() = 0

Public Functions

virtual void setEventHandler(IGenEventHandler *eh) = 0

Set viewport event handler. Viewport will send messages associated with it’s events to this event handler.

Parameters:

eh[in] - pointer to event handler

virtual int handleCommand(int p1 = 0, int p2 = 0, int p3 = 0) = 0
class IGizmoClient
#include <ec_interface.h>

Interface class to Gizmo. Used to receive messages from Gizmo.

Subclassed by ObjectEditor

Methods called by Gizmo to get its own coordinates, angles, scaling.

virtual Point3 getPt() = 0

Get current Gizmo position

Returns:

Gizmo position

inline virtual bool getRot(Point3 &p)

Get current Gizmo Euler angles. Used to set values in proper toolbar fields.

Parameters:

p[out] - Euler angles

Returns:

true if the function succeeds, false in other case

inline virtual bool getScl(Point3 &p)

Get current Gizmo scaling in X,Y,Z dimensions.

Parameters:

p[out] - X,Y,Z scaling ratio

Returns:

true if the function succeeds, false in other case

inline virtual bool getAxes(Point3 &ax, Point3 &ay, Point3 &az)

Get current Gizmo X,Y,Z axes

Parameters:
  • ax[out] - X axis

  • ay[out] - Y axis

  • az[out] - Z axis

Returns:

true if the function succeeds, false in other case

inline virtual bool shouldComputeDeltaFromStartPos()

Switch between relative and absolute deltas passed to changed()

Returns:

true to make changed() calls receive total delta since startGizmo()

Methods called by Gizmo to inform client code about Gizmo’s changes.

virtual void changed(const Point3 &delta) = 0

Gizmo changed event handler. Called when Gizmo changed its coordinates, axes, scaling etc

Parameters:

delta[in] - Gizmo changing (depends on mode):

  • Move - position relative to last call of getPt()

  • Rotation - current Euler angles

  • Scale - current scale

virtual void gizmoStarted() = 0

Called when user clicks any Gizmo axis. i.e. at the begining of changing Gizmo’s position, axes, etc

virtual void gizmoEnded(bool apply) = 0

Called at the end of Gizmo’s changing

Parameters:

apply[in] - true - apply changes that take place in interval between gizmoStarted() and gizmoEnded() false - do not apply changes

virtual void release() = 0

Called at the moment of destroying Gizmo.

virtual bool canStartChangeAt(IGenViewportWnd *wnd, int x, int y, int gizmo_sel) = 0

Informs Gizmo that it can begin changing. Called when user presses left mouse button.

Parameters:
  • wnd[in] - pointer to viewport window (where user clicks)

  • x, y[in] - x,y coordinates where user clicks

  • gizmo_sel[in] - axes flags (what axes selected)

Returns:

true - method gizmoStarted() will be called and normal work with Gizmo beginsfalse - no actions

virtual bool isMouseOver(IGenViewportWnd *wnd, int x, int y) = 0

Test whether mouse cursor is on the object.

Parameters:
  • wnd[in] - pointer to viewport window (where user clicks)

  • x, y[in] - x,y coordinates where user clicks

Returns:

true if mouse cursor is on the object, false in other case

inline virtual int getAvailableTypes()

Returns flags which informs Gizmo about modes supported by plugin

Returns:

flags representing types of modes supported by plugin

inline virtual bool usesRendinstPlacement() const
inline virtual void saveNormalOnSelection(const Point3&)
inline virtual void setCollisionIgnoredOnSelection()
inline virtual void resetCollisionIgnoredOnSelection()
class IGizmoObject
#include <ec_IGizmoObject.h>

Public Functions

virtual TMatrix getTm() const = 0
virtual void setTm(const TMatrix &new_tm) = 0
virtual void onStartChange() = 0
virtual const char *getUndoName() const = 0
inline virtual int getAvailableAxis() const
class IHDRChangeSettingsClient
#include <ec_interface_ex.h>

Public Functions

virtual void onHDRSettingsChanged() = 0

Public Static Attributes

static constexpr unsigned HUID = 0x006003ABu
class IMainWindowImguiRenderingService
#include <ec_interface_ex.h>

Public Functions

inline virtual void beforeUpdateImgui()
inline virtual void updateImgui()

Public Static Attributes

static constexpr unsigned HUID = 0x30B1B0D1u
class INamespace
#include <ec_interface_ex.h>

Interface class for name generation routine. Used during objects name generation in Editor. All plugins that create named objects support this interface. The Editor may poll all plugins by means of INamespace to know if an object name be unique.

Public Functions

virtual bool isUniqName(const char *name) = 0

Test whether object name is unique for current plugin. Called by Editor.

Parameters:

name[in] - tested name

Returns:

true if name is unique for current plugin, false in other case

struct Inertia
#include <ec_camera_dlg.h>

Inertia parameters of a camera.

Public Functions

void load(const DataBlock &blk)

Load inertia parameters from BLK file.

Parameters:

blk[in] - Data Block that contains data to load (see #DataBlock)

void save(DataBlock &blk)

Save inertia parameters to BLK file.

Parameters:

blk[in] - Data Block that contains data to save (see #DataBlock)

inline Inertia()

Constructor.

Public Members

real stop

Smoothness factor of a camera stopping process. The greater this value, the longer camera will do stoppinng.

real move

Smoothness factor of a camera acceleration process. The greater this value, the longer camera will do acceleration.

struct Input

Public Members

int mouseX = 0
int mouseY = 0
bool lmbPressed = false
bool rmbPressed = false
class IObjectCreator

Subclassed by BoxCreator, CylinderCreator, PlaneCreator, PointCreator, PolyMeshCreator, PolygoneZoneCreator, SphereCreator, SplineCreator, SurfaceMoveCreator, TargetCreator

Mouse events handlers.

bool stateFinished
bool stateOk
inline virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif, bool rotate = true)

Mouse move event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

  • rotate[in] - if false

    , then box sides will be parallel to world coordinate axes

    - if

    true, then box base will be set as pointed by user

Returns:

true if event handling successful, false in other case

inline virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif)

Mouse left button press event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

inline virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif)

Mouse left button release event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

inline virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif)

Mouse right button press event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

inline virtual void render()

Render BoxCreator. Called from program code that created BoxCreator.

Public Functions

inline IObjectCreator()

Constructor.

inline bool isFinished()

Test whether drawing of plane is finished.

Returns:

true if drawing of plane is finished - plane is finished or drawing canceled (user clicked on right mouse button),false if drawing is not finished yet

inline bool isOk()

Test whether plane creation is successful.

Returns:

true if plane creation is successful - user clicked 2 times and defined length,width of the plane,false if plane creation is not successful

Public Members

TMatrix matrix

Matrix defining box parameters.

class IObjectsList
#include <ec_interface_ex.h>

Interface class for dialog window ‘Select objects by name’.

(Called by key ‘H’)

Subclassed by ObjectEditor

Public Functions

virtual void getObjNames(Tab<String> &names, Tab<String> &sel_names, const Tab<int> &types) = 0

Get objects names. The function passes object names to dialog window.

Parameters:
  • names[out] - list of objects names

  • sel_names[out] - list of selected objects names

  • types[in] - list of object types to be represented. Defined as a list of indexes. To get full list of types use getTypeNames().

virtual void getTypeNames(Tab<String> &names) = 0

Get objects types. The function passes object types to dialog window.

Parameters:

names[out] - list of objects types

virtual void onSelectedNames(const Tab<String> &names) = 0

Informs client code about selecting / deselecting objects in list.

Parameters:

names[in] - names list of selected objects

class IOutliner

Public Functions

virtual int getTypeCount() = 0
virtual const char *getTypeName(int type, bool plural = false) = 0
virtual bool isTypeVisible(int type) = 0
virtual bool isTypeLocked(int type) = 0
virtual bool canAddNewLayerWithName(int type, const char *name, String &error_message) = 0
virtual void selectAllTypeObjects(int type, bool select) = 0
virtual void toggleTypeVisibility(int type) = 0
virtual void toggleTypeLock(int type) = 0
virtual int addNewLayer(int type, const char *name) = 0
virtual int getLayerCount(int type) = 0
virtual const char *getLayerName(int type, int per_type_layer_index) = 0
virtual bool isLayerActive(int type, int per_type_layer_index) = 0
virtual bool isLayerVisible(int type, int per_type_layer_index) = 0
virtual bool isLayerLocked(int type, int per_type_layer_index) = 0
virtual bool isLayerAppliedToMask(int type, int per_type_layer_index) = 0
virtual bool isLayerExported(int type, int per_type_layer_index) = 0
virtual bool canChangeLayerVisibility(int type, int per_type_layer_index) = 0
virtual bool canChangeLayerLock(int type, int per_type_layer_index) = 0
virtual bool isLayerRenameable(int type, int per_type_layer_index) = 0
virtual bool canRenameLayerTo(int type, int per_type_layer_index, const char *name, String &error_message) = 0
virtual void setLayerActive(int type, int per_type_layer_index) = 0
virtual void selectAllLayerObjects(int type, int per_type_layer_index, bool select) = 0
virtual void toggleLayerVisibility(int type, int per_type_layer_index) = 0
virtual void toggleLayerLock(int type, int per_type_layer_index) = 0
virtual void toggleLayerApplyToMask(int type, int per_type_layer_index) = 0
virtual void toggleLayerExport(int type, int per_type_layer_index) = 0
virtual void renameLayer(int type, int per_type_layer_index, const char *name) = 0
virtual bool isObjectSelected(RenderableEditableObject &object) = 0
virtual bool canSelectObject(RenderableEditableObject &object) = 0
virtual bool canRenameObject(RenderableEditableObject &object, const char *name, String &error_message) = 0
virtual bool getObjectTypeAndPerTypeLayerIndex(RenderableEditableObject &object, int &type, int &per_type_layer_index) = 0
virtual const char *getObjectAssetName(RenderableEditableObject &object) = 0
virtual int getObjectAssetType(RenderableEditableObject &object, const char *&asset_type_name) = 0
virtual bool isSampleObject(RenderableEditableObject &object) = 0
virtual void startObjectSelection() = 0
virtual void setObjectSelected(RenderableEditableObject &object, bool selected) = 0
virtual void endObjectSelection() = 0
virtual void unselectAllObjects() = 0
virtual void moveObjectsToLayer(dag::Span<RenderableEditableObject*> objects, int type, int per_type_destination_layer_index) = 0
virtual void renameObject(RenderableEditableObject &object, const char *name) = 0
virtual void changeObjectAsset(dag::Span<RenderableEditableObject*> objects) = 0
virtual void deleteObjects(dag::Span<RenderableEditableObject*> objects) = 0
virtual void zoomAndCenterObject(RenderableEditableObject &object) = 0
class IRenderingService
#include <ec_interface_ex.h>

Public Types

enum Stage

Values:

enumerator STG_BEFORE_RENDER
enumerator STG_RENDER_SHADOWS
enumerator STG_RENDER_ENVI
enumerator STG_RENDER_STATIC_OPAQUE
enumerator STG_RENDER_STATIC_DECALS
enumerator STG_RENDER_DYNAMIC_OPAQUE
enumerator STG_RENDER_DYNAMIC_DECALS
enumerator STG_RENDER_STATIC_TRANS
enumerator STG_RENDER_DYNAMIC_TRANS
enumerator STG_RENDER_STATIC_DISTORTION
enumerator STG_RENDER_DYNAMIC_DISTORTION
enumerator STG_RENDER_FX_LOWRES
enumerator STG_RENDER_FX
enumerator STG_RENDER_FX_DISTORTION
enumerator STG_RENDER_SHADOWS_VSM
enumerator STG_RENDER_SHADOWS_FOM
enumerator STG_RENDER_TO_CLIPMAP
enumerator STG_RENDER_TO_CLIPMAP_LATE
enumerator STG_RENDER_HEIGHT_FIELD
enumerator STG_RENDER_GRASS_MASK
enumerator STG_RENDER_CLOUDS
enumerator STG_RENDER_LAND_DECALS
enumerator STG_RENDER_WATER_PROJ
enumerator STG_RENDER_HEIGHT_PATCH

Public Functions

virtual void renderGeometry(Stage stage) = 0
inline virtual void renderUI()
inline virtual int setSubDiv(int)
inline virtual void prepare(const Point3 &center_pos, const BBox3 &box)

Public Static Attributes

static constexpr unsigned HUID = 0x80C30E29u
struct Item

Public Members

PropPanel::TLeafHandle handle
PropPanel::TLeafHandle group
int id
bool value
class IVisibilityFinderProvider
#include <ec_interface_ex.h>

Public Functions

virtual VisibilityFinder &getVisibilityFinder() = 0

Public Static Attributes

static constexpr unsigned HUID = 0x509D8ABEu
class IWndManager
#include <ec_wndPublic.h>

Public Functions

inline virtual ~IWndManager()
virtual int run(int width, int height, const char *caption, const char *icon = "", WindowSizeInit size = WSI_NORMAL) = 0
virtual void close() = 0
virtual bool loadLayout(const char *filename = NULL) = 0
virtual void saveLayout(const char *filename = NULL) = 0
virtual void setMainWindowCaption(const char *caption) = 0
virtual void registerWindowHandler(IWndManagerWindowHandler *handler) = 0
virtual void unregisterWindowHandler(IWndManagerWindowHandler *handler) = 0
virtual void reset() = 0
virtual void show(WindowSizeInit size = WSI_NORMAL) = 0
virtual void *getMainWindow() const = 0
virtual bool removeWindow(void *handle) = 0
virtual void setWindowType(void *handle, int type) = 0
virtual void getWindowClientSize(void *handle, unsigned &width, unsigned &height) = 0
virtual bool getWindowPosSize(void *handle, int &x, int &y, unsigned &width, unsigned &height) = 0
virtual void setMenuArea(void *handle, hdpi::Px width, hdpi::Px height) = 0
virtual bool init3d(const char *drv_name = NULL, const DataBlock *blkTexStreaming = NULL) = 0
virtual void addAccelerator(unsigned cmd_id, ImGuiKeyChord key_chord) = 0
virtual void addAcceleratorUp(unsigned cmd_id, ImGuiKeyChord key_chord) = 0
virtual void addViewportAccelerator(unsigned cmd_id, ImGuiKeyChord key_chord, bool allow_repeat = false) = 0
virtual void clearAccelerators() = 0
virtual unsigned processImguiAccelerator() = 0
virtual unsigned processImguiViewportAccelerator(ImGuiID viewport_id) = 0
virtual void initCustomMouseCursors(const char *path) = 0
virtual void updateImguiMouseCursor() = 0

Public Static Functions

static IWndManager *createManager(IWndManagerEventHandler *event_handler)
class IWndManagerEventHandler
#include <ec_wndPublic.h>

Public Functions

virtual void onInit(IWndManager *manager) = 0
virtual bool onClose() = 0
virtual void onDestroy() = 0
class IWndManagerWindowHandler
#include <ec_wndPublic.h>

Subclassed by ObjectEditor

Public Functions

virtual void *onWmCreateWindow(int type) = 0
virtual bool onWmDestroyWindow(void *window) = 0
class MaxCameraElem : public CCameraElem
#include <ec_camera_elem.h>

Public Functions

inline MaxCameraElem()
inline virtual void handleKeyboardInput(unsigned) override

Handle keyboard input using polling.

inline virtual void handleMouseWheel(int) override

Handle mouse wheel rotation.

Parameters:

delta[in] - if it’s > 0 then the wheel was rotated forward (away from user), if < 0 then it was rotated backward

class NewProjectDialog : public PropPanel::DialogWindow
#include <ec_newProjDlg.h>

Public Functions

NewProjectDialog(void *phandle, const char *caption, const char *name_label = NULL, const char *_note = NULL)
const char *getName()
const char *getLocation()
void setName(const char *s)
void setLocation(const char *s)
void onChange(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
bool onOk() override

Private Members

String mName
String mLocation
class ObjectEditor : public IGizmoClient, public IGenEventHandler, public IObjectsList, public IWndManagerWindowHandler, public PropPanel::IMenuEventHandler, public PropPanel::ControlEventHandler
#include <ec_ObjectEditor.h>

3D objects Editor. Used in conjunction with RenderableEditableObject. May be fairly simply built into different editors.

Methods for creating new objects

enum class PlacementRotation

Values:

enumerator NO_ROTATION
enumerator X_TO_NORMAL
enumerator Y_TO_NORMAL
enumerator Z_TO_NORMAL
String objListOwnerName
PtrTab<RenderableEditableObject> objects
PtrTab<RenderableEditableObject> selection
Point3 gizmoPt
Point3 gizmoOrigin
Point3 gizmoScl
Point3 gizmoRot
Point3 gizmoSclO
Point3 gizmoRotO
Point3 gizmoRotPoint
bool isGizmoStarted
bool areObjectPropsValid
PlacementRotation selectedPlacementRotation = PlacementRotation::NO_ROTATION
RenderableEditableObject *sample
IObjectCreator *creator
ObjectEditorPropPanelBar *objectPropBar
DataBlock objectPropSettings
int toolBarId
int editMode
int lastY
int rotDy
int scaleDy
real createRot
real createScale
bool canTransformOnCreate
bool justCreated
bool pressedRightMouseButtonWhileCreating = false
bool updateViewportGizmo = true
int suffixDigitsCount
String filterString
Tab<SimpleString> filterStrings
bool invFilter = false
static bool placeTypeRadio
virtual void setCreateMode(IObjectCreator *creator = NULL)

Called to start or stop object creation mode.

Parameters:

creator[in] - creator to use

virtual void setCreateBySampleMode(RenderableEditableObject *sample = NULL)

Called to start or stop object creation mode.

Parameters:

sample[in] - object to clone

virtual void createObject(IObjectCreator *creator)

this method can be overrided to create objects default implementation does nothing, but finishes creation process

Parameters:

creator[in] - creator to use

virtual void createObjectBySample(RenderableEditableObject *sample)

this method can be overrided to create objects default implementation does nothing

Parameters:

sample[in] - object to clone

virtual void registerViewportAccelerators(IWndManager &wndManager)
inline int onMenuItemClick(unsigned id) override
static inline bool getPlaceTypeRadio()
static inline void setPlaceTypeRadio(bool is_radio)
TMatrix getPlacementRotationMatrix()
virtual void onAddObject(RenderableEditableObject &obj)
virtual void _addObjects(RenderableEditableObject **obj, int num, bool use_undo)
virtual void onRemoveObject(RenderableEditableObject &obj)
virtual void _removeObjects(RenderableEditableObject **obj, int num, bool use_undo)
virtual Point3 getSurfMoveGizmoPos(const Point3 &obj_pos) const
virtual ObjectEditorPropPanelBar *createEditorPropBar(void *handle)
virtual void saveEditorPropBarSettings()
virtual void *onWmCreateWindow(int type) override
virtual bool onWmDestroyWindow(void *window) override
void onClick(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
void onChange(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
virtual void moveObjects(PtrTab<RenderableEditableObject> &obj, const Point3 &delta, IEditorCoreEngine::BasisType basis)
inline virtual void fillSelectionMenu(IGenViewportWnd *wnd, PropPanel::IMenu *menu)

Implementation of IObjectsList methods for selecting objects by name

virtual void getObjNames(Tab<String> &names, Tab<String> &sel_names, const Tab<int> &types) override

Get objects names. The function passes object names to dialog window.

Parameters:
  • names[out] - list of objects names

  • sel_names[out] - list of selected objects names

  • types[in] - list of object types to be represented. Defined as a list of indexes. To get full list of types use getTypeNames().

inline virtual void getTypeNames(Tab<String> &names) override

Get objects types. The function passes object types to dialog window.

Parameters:

names[out] - list of objects types

virtual void onSelectedNames(const Tab<String> &names) override

Informs client code about selecting / deselecting objects in list.

Parameters:

names[in] - names list of selected objects

virtual UndoSystem *getUndoSystem()

Get Undo system. Get ObjectEditor’s Undo system. Default implementation returns global Undo system of the Editor. Override this method if you need local Undo system.

Returns:

pointer to ObjectEditor’s Undo system

ToolBar methods, useful button functions.

virtual void initUi(int toolbar_id)

Initialize User Interface of an Object Editor.

Parameters:

toolbar_id[in] - toolbar’s id to use.

virtual void closeUi()

Close User Interface of an Object Editor.

virtual void fillToolBar(PropPanel::ContainerPropertyControl *toolbar)

Fill ToolBar with buttons (called from initUi()). Override to add custom buttons to toolbar.

virtual void addButton(PropPanel::ContainerPropertyControl *tb, int id, const char *bmp_name, const char *hint, bool check = false)

Add button to toolbar.

Parameters:
  • tb[in] - pointer to toolbar

  • cmd[in] - button command id

  • bmp_name[in] - pointer to button’s bitmap name

  • hint[in] - pointer to hint string

  • check[in] - is check button

virtual void enableButton(int id, bool state)

Enable button.

Parameters:
  • id[in] - button ID

  • state[in] - true / false: enabled / disabled

virtual void setButton(int id, bool state)

Set check-like button state.

Parameters:
  • id[in] - button ID

  • state[in] - true / false: checked / not checked

virtual void setRadioButton(int id, int value_id)

Set Radio Button state (calls setButton(tb, id, value_id==id)).

Parameters:
  • id[in] - button ID

  • value_id[in] - if value_id==id set specified radio button on (other buttons of button’s groop are set to off)

virtual void updateToolbarButtons()

Update toolbar buttons (check-like and radio buttons) state. Override if custom buttons are added to toolbar.

virtual void selectByNameDlg()

Open ‘Select by name’ dialog window to select objects from objects list by name.

virtual void dropObjects()

Drop selected objects on surface.

virtual void setEditMode(int mode)

Set Edit Mode.

Parameters:

mode[in]

- Edit mode:

- CM_OBJED_MODE_SELECT - ‘Select’ mode

- CM_OBJED_MODE_MOVE - ‘Move’ mode

- CM_OBJED_MODE_SURF_MOVE - ‘Surface move’ mode

- CM_OBJED_MODE_ROTATE - ‘Rotate’ mode

- CM_OBJED_MODE_SCALE - ‘Scale’ mode

virtual void showPanel()

Show/hide Property Panel.

inline bool isPanelShown() const
PropPanel::ContainerPropertyControl *createPanelGroup(int pid)

Create custom groups on visible panel with a given pid. Property panel implementation handles the creation.

virtual void createPanelTransform(int mode)

Create editable object transform controls on the panel for a given edit mode. Property panel implementation handles the creation.

void loadPropPanelSettings(const DataBlock &settings)
void savePropPanelSettings(DataBlock &settings)
inline virtual int getEditMode()

Get Edit Mode.

virtual void updateGizmo(int basis = IEditorCoreEngine::BASIS_None, int *modeOverride = nullptr)

Update Gizmo state.

inline virtual bool getUpdateViewportGizmo() const

Get/set the flag indicating viewport state invalidation of gizmo on state update.

inline virtual void setUpdateViewportGizmo(bool update)
virtual bool setUniqName(RenderableEditableObject *o, const char *n)

Make from n (if needed) and set uniq name for object o.

inline void setSuffixDigitsCount(int c)
inline virtual void getLayerNames(int type, Tab<String> &names)

Get layer names for a given object type.

static IEditorCoreEngine::ModeType editModeToModeType(int editMode)

Editing objects (add, remove, render).

inline virtual void addObjects(RenderableEditableObject **obj, int num, bool use_undo = true)

Add objects to Editor.

Parameters:
  • obj[in] - array of pointers to objects to add to

  • num[in] - number of objects to add to

  • use_undo[in] - true / false: use / not use undo system

inline virtual void removeObjects(RenderableEditableObject **obj, int num, bool use_undo = true)

Remove objects from Editor.

Parameters:
  • obj[in] - array of pointers to objects to remove

  • num[in] - number of objects to remove

  • use_undo[in] - true / false: use / not use undo system

virtual void removeAllObjects(bool use_undo = true)

Remove all objects from Editor.

Parameters:

use_undo[in] - true / false: use / not use undo system

inline void addObject(RenderableEditableObject *obj, bool use_undo = true)

Add one object to Editor.

Parameters:

obj[in] - pointer to object to add to

inline void removeObject(RenderableEditableObject *obj, bool use_undo = true)

Remove one object from Editor.

Parameters:
  • obj[in] - pointer to object to remove

  • use_undo[in] - true / false: use / not use undo system

virtual void update(real dt)

Update objects, Gizmo, etc in accordance with time specified. Should be called from outside the ObjectEditor in order it may properly function.

Parameters:

dt[in] - time passed

virtual void beforeRender()

Prepare objects for rendering. Should be called from outside the ObjectEditor in order it may properly function.

virtual void render()

Render opaque objects parts. Should be called from outside the ObjectEditor in order it may properly function.

virtual void renderTrans()

Render transparent objects parts. Should be called from outside the ObjectEditor in order it may properly function.

virtual void updateImgui()

Editing objects (object count, get objects, etc).

inline int objectCount() const

Get object count.

Returns:

object count

inline RenderableEditableObject *getObject(int index) const

Get object from objects list by index.

Parameters:

index[in] - object index

Returns:

pointer to object

RenderableEditableObject *getObjectByName(const char *name) const

Get object by name (case insensitive).

Parameters:

name[in] - pointer to name string

Returns:

pointer to object. If there are many appropriate objects then function returns pointer to the first object.

RenderableEditableObject *pickObject(IGenViewportWnd *wnd, int x, int y)

Pick one object in viewport point having specified coordinates. Hidden and frozen objects are ignored.

Parameters:
  • wnd[in] - pointer to viewport window

  • x, y[in] - x,y point coordinates

Returns:

pointer to the first object found

virtual bool pickObjects(IGenViewportWnd *wnd, int x, int y, Tab<RenderableEditableObject*> &objs)

Pick objects in viewport point having specified coordinates. Hidden and frozen objects are ignored.

Parameters:
  • wnd[in] - pointer to viewport window

  • x, y[in] - x,y point coordinates

  • objs[out] - reference to array of pointers to objects found

Returns:

true if one or many objects were picked, false in other case

bool checkObjSelFilter(RenderableEditableObject &obj)

Editing objects (edit selected objects).

virtual void updateSelection()

Update object selection list in accordance with their FLG_SELECTED flags.

inline int selectedCount() const

Get selected objects count.

Returns:

selected objects count

inline RenderableEditableObject *getSelected(int index) const

Get selected object from objects list by index.

Parameters:

index[in] - object index

Returns:

pointer to object selected

virtual bool canSelectObj(RenderableEditableObject *o)

Can the object selected by the user. For example hidden objects cannot be selected.

virtual void unselectAll()

Unselect all objects.

virtual void selectAll()

Select all objects.

virtual bool getSelectionBox(BBox3 &box) const

Get bounding box for objects selected.

Parameters:

box[out] - reference to bounding box

Returns:

true if operation successful, false in other case

virtual void deleteSelectedObjects(bool use_undo = true)

Delete selected objects.

Parameters:

use_undo[in] - true / false: use / not use undo system

Editing objects (methods called by events).

virtual void onObjectFlagsChange(RenderableEditableObject *obj, int changed_flags)

Called when object flags are changed.

Parameters:
  • obj[in] - pointer to object whose flags are changed

  • changed_flags[in] - FLG_SELECTED,FLG_HIDDEN, FLG_FROZEN,FLG_HIGHLIGHTED

virtual void onObjectGeomChange(RenderableEditableObject *obj)

Called when object geometry is changed.

Parameters:

obj[in] - pointer to object whose geometry is changed

virtual void selectionChanged()

Called each time an object is selected or deselected, so it should only set flags etc, and not perform long actions.

virtual void saveNormalOnSelection(const Point3 &n) override
virtual void setCollisionIgnoredOnSelection() override
virtual void resetCollisionIgnoredOnSelection() override

Editing objects (renaming, object properties).

virtual void renameObject(RenderableEditableObject *obj, const char *new_name, bool use_undo = true)

Rename object. The function tests if renaming is possible and if specified name is unique. NOTE: If new name is not unique, it will be changed and resulting name will be different.

Parameters:
  • obj[in] - pointer to object

  • new_name[in] - pointer to string with new name

  • use_undo[in] - true / false: use / not use undo system

virtual void invalidateObjectProps()

Indicate the need for updating object properties (on Property Panel).

virtual void updateObjectProps()

Update object properties on Property Panel. Commonly called implicitly after some time since call to invalidateObjectProps()

Methods inherited from IGizmoClient

inline virtual void release() override

Called at the moment of destroying Gizmo.

virtual Point3 getPt() override

Get current Gizmo position

Returns:

Gizmo position

virtual bool getRot(Point3 &p) override

Get current Gizmo Euler angles. Used to set values in proper toolbar fields.

Parameters:

p[out] - Euler angles

Returns:

true if the function succeeds, false in other case

virtual bool getScl(Point3 &p) override

Get current Gizmo scaling in X,Y,Z dimensions.

Parameters:

p[out] - X,Y,Z scaling ratio

Returns:

true if the function succeeds, false in other case

virtual bool getAxes(Point3 &ax, Point3 &ay, Point3 &az) override

Get current Gizmo X,Y,Z axes

Parameters:
  • ax[out] - X axis

  • ay[out] - Y axis

  • az[out] - Z axis

Returns:

true if the function succeeds, false in other case

virtual void changed(const Point3 &delta) override

Gizmo changed event handler. Called when Gizmo changed its coordinates, axes, scaling etc

Parameters:

delta[in] - Gizmo changing (depends on mode):

  • Move - position relative to last call of getPt()

  • Rotation - current Euler angles

  • Scale - current scale

virtual bool canStartChangeAt(IGenViewportWnd *wnd, int x, int y, int gizmo_sel) override

Informs Gizmo that it can begin changing. Called when user presses left mouse button.

Parameters:
  • wnd[in] - pointer to viewport window (where user clicks)

  • x, y[in] - x,y coordinates where user clicks

  • gizmo_sel[in] - axes flags (what axes selected)

Returns:

true - method gizmoStarted() will be called and normal work with Gizmo beginsfalse - no actions

virtual bool isMouseOver(IGenViewportWnd *wnd, int x, int y) override

Test whether mouse cursor is on the object.

Parameters:
  • wnd[in] - pointer to viewport window (where user clicks)

  • x, y[in] - x,y coordinates where user clicks

Returns:

true if mouse cursor is on the object, false in other case

virtual void gizmoStarted() override

Called when user clicks any Gizmo axis. i.e. at the begining of changing Gizmo’s position, axes, etc

virtual void gizmoEnded(bool apply) override

Called at the end of Gizmo’s changing

Parameters:

apply[in] - true - apply changes that take place in interval between gizmoStarted() and gizmoEnded() false - do not apply changes

virtual int getAvailableTypes() override

Returns flags which informs Gizmo about modes supported by plugin

Returns:

flags representing types of modes supported by plugin

Methods inherited from IGenEventHandler

virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse move.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse left button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse left button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse right button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

virtual bool handleMouseRBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse right button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseCBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse center button press

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseCBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Handle mouse center button release

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if an event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseWheel(IGenViewportWnd *wnd, int wheel_d, int x, int y, int key_modif) override

Handle mouse scroll wheel

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • wheel_d[in] - scroll wheel steps

  • x, y[in] - x,y coordinates inside viewport

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual bool handleMouseDoubleClick(IGenViewportWnd *wnd, int x, int y, int key_modif) override

Handle mouse double-click

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if an event successfully processed, false in other case

inline virtual void handleViewportPaint(IGenViewportWnd *wnd) override

Viewport CTL window redraw

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • dc[in] - viewport’s device context

inline virtual void handleViewChange(IGenViewportWnd *wnd) override

Viewport view change notification

Parameters:

wnd[in] - pointer to viewport window that generated the message

Public Functions

ObjectEditor()

Constructor.

~ObjectEditor() override

Destructor.

Public Members

bool isGizmoValid

Friends

friend class ObjectEditorWrap
class ObjectEditorPropPanelBar : public PropPanel::ControlEventHandler
#include <ec_ObjectEditor.h>

Public Functions

ObjectEditorPropPanelBar(ObjectEditor *obj_ed, void *hwnd, const char *caption)
~ObjectEditorPropPanelBar() override
void onChange(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
void onClick(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
void onPostEvent(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
virtual void fillPanel()
virtual void refillPanel()
virtual PropPanel::ContainerPropertyControl *createPanelGroup(int pid)
virtual void createPanelTransform(int mode)
virtual void updateName(const char *name)
virtual void updateTransform()
virtual void loadSettings(DataBlock &settings)
virtual void saveSettings(DataBlock &settings) const
inline PropPanel::PanelWindowPropertyControl *getPanel()

Protected Functions

void getObjects()
void onTransformChange(int pcb_id, PropPanel::ContainerPropertyControl *panel, int mode)
Point3 getObjectTransform(int mode)
void setObjectTransform(int mode, Point3 val)
void updateTransformPart(int mode)

Protected Attributes

ObjectEditor *objEd
PtrTab<RenderableEditableObject> objects
PropPanel::PanelWindowPropertyControl *propPanel

Protected Static Functions

static int getPidForEditMode(int mode)
struct OrtMultiScrData
#include <ec_genappwnd.h>

Public Functions

inline OrtMultiScrData()

Public Members

bool useIt
bool renderObjects
Point2 mapPos
Point2 mapSize
int tileSize
float res
int q_type
int mipLevels
struct OrtScrCells
#include <ec_genappwnd.h>

Public Functions

inline OrtScrCells()
inline void reset()

Public Members

Point2 mapPos
Point2 mapSize
Point2 tileInMeters
IPoint2 sizeInTiles
class OutlinerWindow : public PropPanel::IMenuEventHandler, public PropPanel::IDelayedCallbackHandler
#include <ec_outliner.h>

Public Functions

OutlinerWindow()
virtual ~OutlinerWindow()
inline void setTreeInterface(IOutliner *tree_interface)
virtual void fillTypesAndLayers()
virtual void loadOutlinerSettings(const DataBlock &settings)
virtual void saveOutlinerSettings(DataBlock &settings) const
virtual void loadOutlinerState(const DataBlock &state)
virtual void saveOutlinerState(DataBlock &state) const
virtual void onAddObject(RenderableEditableObject &object)
virtual void onRemoveObject(RenderableEditableObject &object)
virtual void onRenameObject(RenderableEditableObject &object)
virtual void onObjectSelectionChanged(RenderableEditableObject &object)
virtual void onObjectAssetNameChanged(RenderableEditableObject &object)
virtual void onObjectEditLayerChanged(RenderableEditableObject &object)
virtual void updateImgui()

Private Types

enum class MenuItemId

Values:

enumerator SelectAllTypeObjects
enumerator DeselectAllTypeObjects
enumerator MoveToThisLayer
enumerator SelectAllLayerObjects
enumerator DeselectAllLayerObjects
enumerator ExpandLayerChildren
enumerator CollapseLayerChildren
enumerator AddNewLayer
enumerator RenameLayer
enumerator MoveObjectToLayerSubMenu
enumerator MoveObjectToLayerStart
enumerator MoveObjectToLayerEnd
enumerator RenameObject
enumerator ChangeObjectAsset
enumerator DeleteObject
enum class EnsureVisibleRequestState

Values:

enumerator NoRequest
enumerator FoundSelection
enumerator Requested

Private Functions

int onMenuItemClick(unsigned id) override
void onImguiDelayedCallback(void *user_data) override
PropPanel::IconId getObjectAssetTypeIcon(RenderableEditableObject &object)
void handleDragAndDropDropping(int type, int per_type_layer_index)
bool showTypeControls(ObjectTypeTreeItem &tree_item, int type, bool type_visible, bool type_locked, bool dim_type_color, const ImVec4 &dimmed_text_color, float action_buttons_total_width)
bool showLayerControls(LayerTreeItem &tree_item, int type, int per_type_layer_index, bool layer_visible, bool layer_locked, bool dim_layer_color, const ImVec4 &dimmed_text_color, float action_buttons_total_width, ImGuiMultiSelectIO *multiSelectIo)
const char *getObjectNoun(int type, int count) const
bool showObjectControls(ObjectTreeItem &tree_item, int type, int per_type_layer_index, bool has_child)
bool showObjectAssetNameControls(ObjectAssetNameTreeItem &tree_item, RenderableEditableObject &object)
void fillTypeContextMenu(int type)
void fillLayerContextMenu(int type, int per_type_layer_index)
void fillObjectContextMenu(int type, int per_type_layer_index)
void createContextMenu(int type, int per_type_layer_index = -1, bool object_menu = false)
void createContextMenuByKeyboard()
LayerTreeItem *getContextMenuTargetLayer() const
void resetContextMenu(PropPanel::IMenu *context_menu = nullptr, int type = -1, int per_type_layer_index = -1)
void updateSelectionHead(OutlinerTreeItem &tree_item)
void fillTree(ImGuiMultiSelectIO *multiSelectIo)
bool applyRangeSelectionRequestInternal(const ImGuiSelectionRequest &request, OutlinerTreeItem &tree_item, bool &found_first)
void applyRangeSelectionRequest(const ImGuiSelectionRequest &request)
void applySelectionRequests(const ImGuiMultiSelectIO &multi_select_io, bool &started_selecting)
void showAddLayerControls()
void showSettingsPanel(const char *popup_id)

Private Members

IOutliner *treeInterface = nullptr
Icons icons
int addingLayerToType = -1
String addLayerName
String addLayerErrorMessage
bool settingsPanelOpen = false
bool showActionButtonVisibility = true
bool showActionButtonLock = true
bool showActionButtonApplyToMask = true
bool showActionButtonExportLayer = true
eastl::unique_ptr<PropPanel::IMenu> contextMenu
int contextMenuType = -1
int contextMenuPerTypeLayerIndex = -1
eastl::unique_ptr<OutlinerModel> outlinerModel
eastl::unique_ptr<TreeItemInlineRenamerControl> layerRenamer
eastl::unique_ptr<TreeItemInlineRenamerControl> objectRenamer
dag::Vector<eastl::optional<PropPanel::IconId>> assetTypeIcons
RenderableEditableObject *changeAssetRequested = nullptr
EnsureVisibleRequestState ensureVisibleRequested = EnsureVisibleRequestState::NoRequest
const bool searchInputFocusId = false
class PlaneCreator : public IObjectCreator
#include <ec_ObjectCreator.h>

Used for creating planes on scene with mouse.

Mouse events handlers.

unsigned int stageNo
Point3 point0
Point3 point1
Point3 point2
Point2 clientPoint0
Point2 clientPoint2
int wrapedX
int wrapedY
virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif, bool rotate = true) override

Mouse move event handler. Called from program code that created PlaneCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

  • rotate[in] - if false

    , then plane sides will be parallel to world coordinate axes

    - if

    true, then plane base will be set as pointed by user

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button press event handler. Called from program code that created PlaneCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button release event handler. Called from program code that created PlaneCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse right button press event handler. Called from program code that created PlaneCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual void render() override

Render PlaneCreator. Called from program code that created PlaneCreator.

inline unsigned getStageNo() const

Public Functions

PlaneCreator()

Constructor.

Public Members

Point2 halfSize
class PointCreator : public IObjectCreator
#include <ec_ObjectCreator.h>

Used for selecting points on scene with mouse.

Mouse events handlers.

unsigned int stageNo
Point2 clientCenter0
virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif, bool rotate = true) override

Mouse move event handler. Called from program code that created PointCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button press event handler. Called from program code that created PointCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button release event handler. Called from program code that created PointCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse right button press event handler. Called from program code that created PointCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual void render() override

Render PointCreator. Called from program code that created PointCreator.

Public Functions

PointCreator()

Constructor.

struct PolygoneZone
#include <ec_ObjectCreator.h>

Public Functions

inline Tab<Point3> getRoofPoints()
inline real getMaxFloorY()
inline real getHeight()
inline void setHeight(real h)

Public Members

Tab<Point3> points
real topY = 0
class PolygoneZoneCreator : public IObjectCreator
#include <ec_ObjectCreator.h>

Public Functions

PolygoneZoneCreator()
virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif, bool rotate = true) override

Mouse move event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

  • rotate[in] - if false

    , then box sides will be parallel to world coordinate axes

    - if

    true, then box base will be set as pointed by user

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button press event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button release event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse right button press event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual void render() override

Render BoxCreator. Called from program code that created BoxCreator.

inline const PolygoneZone &getPolygoneZone()
inline void setPolygoneZone(const PolygoneZone &p)
inline void setEditHeight(bool enable)

Protected Types

enum class Stages

Values:

enumerator SetPoints
enumerator SetHeight

Protected Functions

void switchStages()

Protected Attributes

Stages stageNo = Stages::SetPoints
Point3 cursorWorldPos = Point3(0, 0, 0)
int nearestPointIndex = -1
int secondNearestPointIndex = -1
int selectedPointIndex = -1
bool isMovingPoint = false
bool canEditHeight = true
PolygoneZone poly
class PolyMeshCreator : public IObjectCreator
#include <ec_ObjectCreator.h>

Public Functions

PolyMeshCreator()
virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif, bool rotate = true) override

Mouse move event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

  • rotate[in] - if false

    , then box sides will be parallel to world coordinate axes

    - if

    true, then box base will be set as pointed by user

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button press event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button release event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse right button press event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual void render() override

Render BoxCreator. Called from program code that created BoxCreator.

Public Members

Tab<Point2> points

Protected Functions

void renderSegment(int point1_id, int point2_id)
void convertPoints()

Protected Attributes

unsigned stageNo
Point2 clientPoint
int wrapedX
int wrapedY
float height
float yPos
bool isRenderFirstPoint
bool isFailedMesh
class RenderableEditableObject : public EditableObject
#include <ec_rendEdObject.h>

Base class for Editor objects with render, undo / redo etc possibilities. Has rendering functions, parameters set methods, some undo / redo operations, base operations for working with #PropertyPanel. Generally used by class ObjectEditor.

Property Panel methods.

Property Panel common group and property PID values.

Values:

enumerator PID_COMMON_GROUP
enumerator PID_TRANSFORM_GROUP
enumerator PID_SEED_GROUP
friend class ObjectEditor
int objFlags
ObjectEditor *objEditor
real surfaceDist
Point3 savedPlacementNormal = Point3(0, 1, 0)
virtual DClassID getCommonClassId(RenderableEditableObject **objects, int num)

RTTI method

Get Common Class Id.

Parameters:
  • objects[in] - array of pointers to objects

  • num[in] - number of objects in array

Returns:

CID_RenderableEditableObject if all objects are of class RenderableEditableObject or derived from it, NullCID in other case

virtual void fillProps(PropPanel::ContainerPropertyControl &panel, DClassID for_class_id, dag::ConstSpan<RenderableEditableObject*> objects)

Fill Property Panel with object properties. Used to place object (group of objects) properties on Property Panel.

Parameters:
  • panel[in] - Property Panel

  • for_class_id[in] - class ID of object(s)

  • objects[in] - array of pointers to objects

virtual void onPPChange(int pid, bool edit_finished, PropPanel::ContainerPropertyControl &panel, dag::ConstSpan<RenderableEditableObject*> objects) = 0

Called when parameter changing on Property Panel is performed.

Parameters:
  • pid[in] - parameter ID

  • edit_finished[in] - true if edit finished, false in other case

  • panel[in] - Property Panel

  • objects[in] - array of pointers to objects

inline virtual void onPPClose(PropPanel::ContainerPropertyControl &panel, dag::ConstSpan<RenderableEditableObject*> objects)

Called when button ‘Close’ on Property Panel is pressed.

Parameters:
  • panel[in] - Property Panel

  • objects[in] - array of pointers to objects

inline virtual void onPPClear(PropPanel::ContainerPropertyControl &panel, dag::ConstSpan<RenderableEditableObject*> objects)

Called before Property Panel will be cleared.

Parameters:
  • panel[in] - Property Panel

  • objects[in] - array of pointers to objects

inline virtual void onPPBtnPressed(int pid, PropPanel::ContainerPropertyControl &panel, dag::ConstSpan<RenderableEditableObject*> objects)

Called when button on Property Panel is pressed.

Parameters:
  • pid[in] - button ID

  • panel[in] - Property Panel

  • objects[in] - array of pointers to objects

inline virtual void onRemove(ObjectEditor *obj_ed)
inline virtual void onAdd(ObjectEditor *obj_ed)
virtual void rememberSurfaceDist()
inline virtual void zeroSurfaceDist()
inline virtual real getSurfaceDist() const
inline const Point3 &getSavedPlacementNormal() const
inline void setSavedPlacementNormal(const Point3 &n)
inline virtual bool usesRendinstPlacement() const
inline virtual void setCollisionIgnored()
inline virtual void resetCollisionIgnored()

Render methods.

virtual void update(real dt) = 0

Object’s act stage. If object plays animation or performs some actions on itself it does that in this method.

Parameters:

dt[in] - the time passed from last call to update()

virtual void beforeRender() = 0

The function is called before render(). In this method object prepares for rendering if needed.

virtual void render() = 0

Render object. Rendered objects may be in selected and frozen status only, render() is not called for hidden objects.

virtual void renderTrans() = 0

Render transparent object elements.

Flags get / set methods.

see. enum RenderableEditableObject::RenderableEditableObjectFlags

inline virtual bool isHidden() const

Test whether the object is hidden.

Returns:

true if object is hidden, false in other case

inline virtual bool isFrozen() const

Test whether the object is frozen.

Returns:

true if object is frozen, false in other case

inline bool isSelected() const

Test whether the object is selected.

Returns:

true if object is selected, false in other case

inline bool isHighlighted() const

Test whether the object is highlighted.

Returns:

true if object is highlighted, false in other case

inline int getFlags() const

Get object flags.

Returns:

object flags

virtual void setFlags(int value, int mask, bool use_undo = true)

Set object flags.

Parameters:
  • value[in] - flags

  • mask[in] - mask used

  • use_undo[in] - if true a corresponding record will be created in undo system

inline virtual void hideObject(bool hide = true)

Hide / show object.

Parameters:

hide[in] - true / false: hide / show object

inline virtual void freezeObject(bool freeze = true)

Freeze / unfreeze object.

Parameters:

freeze[in] - true / false: freeze / unfreeze object

inline virtual void highlightObject(bool highlight = true)

Set object highlighting on / off.

Parameters:

highlight[in] - true / false: set object highlight on / off

inline virtual void selectObject(bool select = true)

Set object selection on / off.

Parameters:

select[in] - true / false: set object selection on / off

Object properties get / set methods

virtual bool isSelectedByRectangle(IGenViewportWnd *vp, const EcRect &rect) const = 0

Test whether part of the object is inside rectangle.

Parameters:
  • vp[in] - pointer to viewport where test is performed

  • rect[in] - rectangle

Returns:

true if object is inside rectangle, false in other case

virtual bool getWorldBox(BBox3 &box) const = 0

Get object bounding box.

Parameters:

box[out] - object bounding box

Returns:

true if object has bounding box

inline virtual bool setName(const char *nm) override

Set object name.

Parameters:

nm[in] - pointer to name string

Returns:

true if operation successful, false in other case

virtual bool setPos(const Point3 &p) override

Set object position.

Parameters:

p[in] - object position

Returns:

true if operation successful, false in other case

virtual bool setSize(const Point3 &p)

Set object scaling in local X,Y,Z-directions.

Parameters:

p[in] - object scalings

Returns:

true if operation successful, false in other case

virtual Point3 getSize() const

Get object scaling in local X,Y,Z-directions.

Returns:

object scalings

virtual bool setRotM3(const Matrix3 &tm)

Rotate object (with #Matrix3).

Parameters:

tm[in] - rotation matrix (see #Matrix3)

Returns:

true if operation successful, false in other case

virtual bool setRotTm(const TMatrix &tm)

Rotate object (with #TMatrix).

Parameters:

tm[in] - rotation matrix (see #TMatrix)

Returns:

true if operation successful, false in other case

virtual Matrix3 getRotM3() const

Get object rotate matrix (#Matrix3).

Returns:

object rotate matrix (#Matrix3)

virtual TMatrix getRotTm() const

Get object rotate matrix (#TMatrix).

Returns:

object rotate matrix (#TMatrix)

virtual Matrix3 getMatrix() const

Get object matrix (#Matrix3).

Returns:

object matrix (#Matrix3)

virtual void setMatrix(const Matrix3 &tm)

Set object matrix (from #Matrix3).

Parameters:

tm[in] - new matrix

inline virtual const TMatrix &getWtm() const

Get object matrix (#TMatrix). return object matrix (#TMatrix)

virtual void setWtm(const TMatrix &wtm)

Set object matrix (#TMatrix).

Parameters:

wtm[in] - new matrix

Object edit methods.

virtual void moveObject(const Point3 &delta, IEditorCoreEngine::BasisType basis)

Move object.

Parameters:
virtual void moveSurfObject(const Point3 &delta, IEditorCoreEngine::BasisType basis)

Move object over surface.

Parameters:
virtual void rotateObject(const Point3 &delta, const Point3 &origin, IEditorCoreEngine::BasisType basis)

Rotate object.

Parameters:
  • delta[in] - object rotation in Euler angles relative to current position

  • origin[in] - center of rotation (if Gizmo’s basis != BASIS_Local)

  • basis[in] - Gizmo basis (see IEditorCoreEngine::BasisType)

virtual void scaleObject(const Point3 &delta, const Point3 &origin, IEditorCoreEngine::BasisType basis)

Scale object.

Parameters:
  • delta[in] - object scalings relative to current sizes

  • origin[in] - center of scaling (if Gizmo’s basis != BASIS_Local)

  • basis[in] - Gizmo basis (see IEditorCoreEngine::BasisType)

Undo / redo methods.

virtual void putMoveUndo()

Put ‘undo move’ data to undo system.

virtual void putRotateUndo()

Put ‘undo rotate’ data to undo system.

virtual void putScaleUndo()

Put ‘undo scale’ data to undo system.

inline virtual bool mayDelete()

Test whether object may be deleted.

Returns:

true if object may be deleted, false in other case

inline virtual bool mayRename()

Test whether object may be renamed.

Returns:

true if object may be renamed, false in other case

inline virtual void onObjectNameChange(RenderableEditableObject *obj, const char *old_name, const char *new_name)

Called when renaming object is performed.

Parameters:
  • obj[in] - pointer to object to be renamed

  • old_name[in] - pointer to old name string

  • new_name[in] - pointer to new name string

inline ObjectEditor *getObjEditor() const

Get ObjectEditor.

Returns:

pointer to ObjectEditor instance whose functions the object uses

Public Types

enum RenderableEditableObjectFlags

Object flags.

Values:

enumerator FLG_SELECTED

Object is selected.

enumerator FLG_HIDDEN

Object is hidden.

enumerator FLG_FROZEN

Object is “frozen”.

enumerator FLG_HIGHLIGHTED

Object is highlighted.

enumerator FLG_WANTRESELECT

Object wants receive every select (even if already selected)

Public Functions

inline RenderableEditableObject()

Constructor 1.

inline RenderableEditableObject(const RenderableEditableObject *fo)

Constructor 2.

~RenderableEditableObject() override

Destructor.

void removeFromEditor()

Remove object from ObjectEditor.

struct ScreenshotConfig
#include <ec_screenshot.h>

Public Members

int width
int height
int size
union ScreenshotConfig
ScreenshotFormat format = DEFAULT_FORMAT
int jpegQuality = DEFAULT_JPEG_Q
bool enableTransparentBackground = false
bool enableDebugGeometry = false
bool nameAsCurrentAsset = false

Public Static Functions

static inline ScreenshotConfig getDefaultCfg()
static inline ScreenshotConfig getDefaultCubeCfg()

Public Static Attributes

static constexpr ScreenshotFormat DEFAULT_FORMAT = ScreenshotFormat::JPEG
static constexpr int DEFAULT_WIDTH = 1024
static constexpr int DEFAULT_HEIGHT = 768
static constexpr int DEFAULT_SIZE = 512
static constexpr int DEFAULT_JPEG_Q = 80
static constexpr int MIN_CUBE_2_POWER = 5
static constexpr int MAX_CUBE_2_POWER = 11
class SelWindow : public PropPanel::DialogWindow
#include <ec_selwindow.h>

Class for dialog window ‘Select objects by name’. (Called by key ‘H’)

Public Functions

SelWindow(void *phandle, IObjectsList *obj, const char *obj_list_owner_name = NULL)

Constructor 1.

Parameters:
  • p – - pointer to parent window (may be NULL)

  • obj – - pointer to interface IObjectsList

SelWindow(void *phandle, const EcRect &rect, IObjectsList *obj, const char *obj_list_owner_name = NULL)

Constructor 2.

Parameters:
  • p – - pointer to parent window (may be NULL)

  • rect[in] - dialog window size

  • obj – - pointer to interface IObjectsList

~SelWindow() override

Destructor.

int showDialog() override
void getSelectedNames(Tab<String> &names)

Get list of selected objects.

Parameters:

names[out] - objects list

Private Functions

void ctorInit()
void fillNames()
void onChange(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
void onClick(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
void onDoubleClick(int pcb_id, PropPanel::ContainerPropertyControl *panel) override

Private Members

const char *objListName
IObjectsList *objects
Tab<String> typeNames
DataBlock *typesBlk
class SphereCreator : public IObjectCreator
#include <ec_ObjectCreator.h>

Used for creating spheres on scene with mouse.

Subclassed by CircleCreator

Mouse events handlers.

unsigned int stageNo
Point2 clientCenter0
virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif, bool rotate = true) override

Mouse move event handler. Called from program code that created SphereCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button press event handler. Called from program code that created SphereCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button release event handler. Called from program code that created SphereCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse right button press event handler. Called from program code that created SphereCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual void render() override

Render SphereCreator. Called from program code that created SphereCreator.

Public Functions

SphereCreator()

Constructor.

Public Members

real radius

Sphere radius.

class SpiralStairCreator : public CylinderCreator
#include <ec_ObjectCreator.h>

Public Functions

virtual void render() override

Render BoxCreator. Called from program code that created BoxCreator.

class SplineCreator : public IObjectCreator
#include <ec_ObjectCreator.h>

Public Functions

SplineCreator()
virtual void render() override

Render BoxCreator. Called from program code that created BoxCreator.

virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif, bool rotate = true) override

Mouse move event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

  • rotate[in] - if false

    , then box sides will be parallel to world coordinate axes

    - if

    true, then box base will be set as pointed by user

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button press event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse right button press event handler. Called from program code that created BoxCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

inline void getPoints(Tab<Point3> &get_points, bool &closed) const
inline void clear()

Private Members

Tab<Point3> points
bool isClosed
bool isRenderFirstPoint
class StairCreator : public BoxCreator
#include <ec_ObjectCreator.h>

Public Functions

virtual void render() override

Render BoxCreator. Called from program code that created BoxCreator.

class SurfaceMoveCreator : public IObjectCreator
#include <ec_ObjectCreator.h>

Mouse events handlers.

virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif, bool rotate = true) override

Mouse move event handler. Called from program code that created SphereCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button press event handler. Called from program code that created SphereCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button release event handler. Called from program code that created SphereCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse right button press event handler. Called from program code that created SphereCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

struct Target
#include <ec_camera_elem.h>

Public Members

Point3 pos
Point3 prevPos
Point3 vel
Point3 acc
bool mayJump
class TargetCreator : public IObjectCreator
#include <ec_ObjectCreator.h>

Used for creating camera targets on scene with mouse.

Mouse events handlers.

unsigned int stageNo
Point2 client0
Point3 point0
virtual bool handleMouseMove(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif, bool rotate = true) override

Mouse move event handler. Called from program code that created TargetCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button press event handler. Called from program code that created TargetCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseLBRelease(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse left button release event handler. Called from program code that created TargetCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual bool handleMouseRBPress(IGenViewportWnd *wnd, int x, int y, bool inside, int buttons, int key_modif) override

Mouse right button press event handler. Called from program code that created TargetCreator.

Parameters:
  • wnd[in] - pointer to viewport window that generated the message

  • x, y[in] - x,y coordinates inside viewport

  • inside[in] - true if the event occurred inside viewport

  • buttons[in] - mouse buttons state flags

  • key_modif[in] - shift keys state (see #CtlShiftKeys)

Returns:

true if event handling successful, false in other case

virtual void render() override

Render TargetCreator. Called from program code that created BoxCreator.

Public Functions

TargetCreator()

Constructor.

Public Members

Point3 target

Camera target position.

class ToolBarManager
#include <ec_status_bar.h>

Toolbar manager. Used to display toolbar with Gizmo parameters, ‘Navigate’ button, etc on it.

Functions called by editor core

int tbId
bool isEnabled
Point3 gizmoPos
int gizmoBasisType
int gizmoCenterType
Tab<String> itemsBasis
Tab<String> itemsCenter
bool isEnabledBtnRotateCenterAndObj
bool controlsInserted
IEditorCoreEngine::ModeType type
IGizmoClient *client
int availableTypes
int moveGizmo
int moveSurfGizmo
int scaleGizmo
int rotateGizmo
virtual void setMoveSnap()

Push / pull ‘Move snap toggle’ button.

virtual void setScaleSnap()

Push / pull ‘Scale snap toggle’ button.

virtual void setRotateSnap()

Push / pull ‘Rotate snap toggle’ button.

bool onChange(int pcb_id, PropPanel::ContainerPropertyControl *panel)

Editor should call onChange in toolbar collback.

void setClientValues(Point3 &val)
void refillTypes()
void setGizmoBasisAndCenter(int bas, int center)
void setEnabled(bool enable)
IEditorCoreEngine::CenterType getCenterTypeByName(const char *name, bool enableRotObj) const
IEditorCoreEngine::BasisType getBasisTypeByName(const char *name) const
const char *getCenterNameByType(IEditorCoreEngine::CenterType type) const
const char *getBasisNameByType(IEditorCoreEngine::BasisType type) const
inline const char *getBasisWorldCaption() const
inline const char *getBasisLocalCaption() const
inline const char *getBasisParentCaption() const
inline const char *getCenterPivotCaption() const
inline const char *getCenterSelectionCaption() const
inline const char *getCenterCoordCaption() const
int getMoveGizmoDef() const
int getMoveSurfGizmoDef() const
int getScaleGizmoDef() const
int getRotateGizmoDef() const
Point3 getClientGizmoValue()
void setGizmoToToolbar(Point3 value)

Toolbar management

void init(int toolbar_id)

Init toolbar.

Parameters:

toolbar_id[in] - toolbar id

Gizmo methods

void setGizmoClient(IGizmoClient *gc, IEditorCoreEngine::ModeType tp)

Set interface IGizmoClient and Gizmo type. Caled by editor core.

Parameters:
void act()

Acts the ToolBarManager. In this function ToolBarManager sets proper values in edit boxes located on assigned toolbar and enables/disables toolbar’s controls. Called by editor core.

IEditorCoreEngine::CenterType getCenterType() const

Get Gizmo’s center type.

Returns:

Gizmo’s center type (see IEditorCoreEngine::CenterType)

IEditorCoreEngine::CenterType getGizmoCenterTypeForMode(IEditorCoreEngine::ModeType tp) const

Get Gizmo center type for a specific mode.

Returns:

Gizmo center type a specific mode (see IEditorCoreEngine::CenterType and see IEditorCoreEngine::ModeType)

IEditorCoreEngine::BasisType getBasisType() const

Get Gizmo’s basis type

Returns:

Gizmo’s basis type (see IEditorCoreEngine::BasisType)

IEditorCoreEngine::BasisType getGizmoBasisTypeForMode(IEditorCoreEngine::ModeType tp) const

Get Gizmo’s basis type for a specific mode

Returns:

Gizmo’s basis type for a specific mode (see IEditorCoreEngine::BasisType and see IEditorCoreEngine::ModeType)

Public Functions

ToolBarManager()

Constructor.

inline virtual ~ToolBarManager()
struct TpsCameraConfig : public FpsCameraConfig
#include <ec_camera_dlg.h>

Public Functions

inline TpsCameraConfig()

Constructor.

inline ~TpsCameraConfig() override

Destructor.

virtual void load(const DataBlock &blk) override

Load camera parameters from BLK file.

Parameters:

blk[in] - Data Block that contains data to load (see #DataBlock)

virtual void save(DataBlock &blk) override

Save camera parameters to BLK file.

Parameters:

blk[in] - Data Block that contains data to save (see #DataBlock)

Public Members

float minDist
float maxMaxDist
float maxOutSpeed
float minVAng
float maxVAng
class TpsCameraElem : public CCameraElem
#include <ec_camera_elem.h>

Subclassed by CarCameraElem

Public Functions

TpsCameraElem()
TpsCameraElem(int cam_type)
virtual void actInternal() override
virtual void render() override
virtual void clear() override
virtual void handleKeyboardInput(unsigned viewport_id) override

Handle keyboard input using polling.

virtual void rotate(real dX, real dY, bool multiplySencetive, bool aroundSelection) override

Rotate camera.

Parameters:
  • dX, dY[in] - rotation angles for X,Y axes

  • multiplySencetive[in] - true: use acceleration, false: camera is not accelerated

  • aroundSelection[in] - true: use rotation center, false: rotation center is not used

virtual void moveForward(real deltaZ, bool multiply_sensitive, IGenViewportWnd *wnd) override

Move camera in Z direction.

Parameters:
  • dZ[in] - camera Z-shift

  • multiplySencetive[in] - true: use acceleration, false: camera is not accelerated

  • wnd[in] - pointer to viewport window

virtual void strife(real dx, real dy, bool multiply_sensitive, bool config_sensitive) override

Strife camera (move along X,Y surface).

Parameters:
  • dx, dy[in] - camera shift in X,Y directions

  • multiply_sencetive[in] - true: use acceleration, false: camera is not accelerated

  • config_sencetive[in] - true: use camera’s ‘Turbo’ coefficient (acceleration for ‘free’ / ‘FPS’ camera if [Shift] key pressed), false: ‘Turbo’ coefficient is not used

void moveOn(const Point3 &dpos)
virtual void handleMouseWheel(int dz) override

Handle mouse wheel rotation.

Parameters:

delta[in] - if it’s > 0 then the wheel was rotated forward (away from user), if < 0 then it was rotated backward

Protected Attributes

struct TpsCameraElem::Target target
float maxDist
struct TpsCameraElem::Cam cam
class TPSCameraTab : public FPSCameraTab
#include <ec_camera_dlg.h>

Public Functions

TPSCameraTab(PropPanel::ContainerPropertyControl *tab_page, CameraConfig *options)
void fill()
void updateConfigFromUserInterface(int pcb_id)
class UndoAddObjects : public UndoRedoObject
#include <ec_ObjectEditor.h>

Public Functions

inline UndoAddObjects(ObjectEditor *oe, int num)
inline void restore(bool save_redo) override
inline void redo() override
inline size_t size() override
inline void accepted() override
inline void get_description(String &s) override

Public Members

ObjectEditor *objEd
PtrTab<RenderableEditableObject> objects
class UndoMatrix : public UndoRedoObject
#include <ec_rendEdObject.h>

Public Functions

inline UndoMatrix(RenderableEditableObject *o)
inline void restore(bool save_redo) override
inline void redo() override
inline size_t size() override
inline void accepted() override
inline void get_description(String &s) override

Public Members

Ptr<RenderableEditableObject> obj
Matrix3 oldMatrix
Matrix3 redoMatrix
class UndoMove : public UndoRedoObject
#include <ec_rendEdObject.h>

Public Functions

inline UndoMove(RenderableEditableObject *o)
inline void restore(bool save_redo) override
inline void redo() override
inline size_t size() override
inline void accepted() override
inline void get_description(String &s) override

Public Members

Ptr<RenderableEditableObject> obj
Point3 oldPos
Point3 redoPos
class UndoObjectEditorRename : public UndoRedoObject
#include <ec_ObjectEditor.h>

Public Functions

inline UndoObjectEditorRename(ObjectEditor *oe, RenderableEditableObject *obj)
inline void restore(bool save_redo) override
inline void redo() override
inline size_t size() override
inline void accepted() override
inline void get_description(String &s) override

Public Members

ObjectEditor *objEd
Ptr<RenderableEditableObject> object
String undoName
String redoName
class UndoObjFlags : public UndoRedoObject
#include <ec_rendEdObject.h>

Public Functions

inline UndoObjFlags(RenderableEditableObject *o)
inline void restore(bool save_redo) override
inline void redo() override
inline size_t size() override
inline void accepted() override
inline void get_description(String &s) override

Public Members

Ptr<RenderableEditableObject> obj
int prevFlags
int redoFlags
class UndoRemoveObjects : public UndoRedoObject
#include <ec_ObjectEditor.h>

Public Functions

inline UndoRemoveObjects(ObjectEditor *oe, int num)
inline void restore(bool save_redo) override
inline void redo() override
inline size_t size() override
inline void accepted() override
inline void get_description(String &s) override

Public Members

ObjectEditor *objEd
PtrTab<RenderableEditableObject> objects
struct ViewportParams

Public Members

TMatrix view
real fov
class ViewportWindow : public IGenViewportWnd, public PropPanel::IMenuEventHandler, public PropPanel::IDelayedCallbackHandler

CTL implementation of viewport window.

Stat3D routine

static unsigned restoreFlags
static Tab<ViewportParams> viewportsParams
int32_t prevMousePositionX
int32_t prevMousePositionY
bool isMoveRotateAllowed
bool isXLocked
bool isYLocked
bool orthogonalProjection
real projectionFov
real projectionFarPlane
real projectionNearPlane
real orthogonalZoom
unsigned int currentProjection
bool updatePluginCamera
ICustomCameras *customCameras
PropPanel::IMenu *popupMenu
PropPanel::IMenu *selectionMenu
bool wireframeOverlay
bool showViewportAxis
ViewportAxisId highlightedViewportAxisId
ViewportAxisId mouseDownOnViewportAxis
TMatrix cameraTransitionLastViewMatrix
Quat cameraTransitionStartQuaternion
Quat cameraTransitionEndQuaternion
float cameraTransitionElapsedTime
bool cameraTransitioning = false
bool allowPopupMenu
struct ViewportWindow rectSelect
IGenEventHandler *curEH
IMenuEventHandler *curMEH
RenderViewport *viewport
int vpId
SimpleString viewText
hdpi::Px nextStat3dLineY
bool showStats
bool calcStat3d
bool opaqueStat3d
bool showCameraStats
bool showCameraPos
bool showCameraDist
bool showCameraFov
bool showCameraSpeed
bool showCameraTurboSpeed
ViewportWindowStatSettingsDialog *statSettingsDialog
IPoint2 restoreCursorAt = IPoint2(0, 0)
Input input
bool mIsCursorVisible
TextureIDHolder viewportTexture
IPoint2 viewportTextureSize = IPoint2(0, 0)
IPoint2 requestedViewportTextureSize = IPoint2(0, 0)
bool mouseButtonDown[mouseButtonDownArraySize]
IPoint2 lastMousePosition = IPoint2(0, 0)
dag::Vector<DelayedMouseEvent*> delayedMouseEvents
eastl::optional<Point3> lastValidCamPanAnchorPoint
eastl::optional<Point3> cameraPanAnchorPoint
eastl::optional<Point2> screenshotSize
bool active = false
static GizmoSettingsDialog *gizmoSettingsDialog
static const int mouseButtonDownArraySize = 5
static GridEditDialog *gridSettingsDialog
inline bool needStat3d() const

Returns true if viewport have to show its 3D statistics.

void drawStat3d()

Draws statistics in viewport window.

virtual void drawText(int x, int y, const String &text) override

Draw statistics/debug texts in the viewport area.

inline bool wireframeOverlayEnabled() const
virtual void setMenuEventHandler(PropPanel::IMenuEventHandler *meh) override

Set secondary menu event handler of viewport.

inline virtual PropPanel::IMenu *getContextMenu() override

Retrieves the custom context menu of the viewport if it’s active/open.

virtual void paint(int w, int h)

Render viewport gui.

virtual bool onDropFiles(const dag::Vector<String> &files)
void showGridSettingsDialog()
void showStatSettingsDialog()
void showGizmoSettingsDialog()
virtual void handleStatSettingsDialogChange(int pcb_id, bool value)

ViewportWindowStatSettingsDialog uses this to forward its onChange notification.

TMatrix getViewTm() const
TMatrix4 getProjTm() const
inline const Input &getInput() const
void registerViewportAccelerators(IWndManager &wnd_manager)
bool handleViewportAcceleratorCommand(unsigned id)
bool isViewportTextureReady() const
void copyTextureToViewportTexture(BaseTexture &source_texture, int source_width, int source_height)
void updateImgui(ImGuiID canvas_id, const Point2 &size, float item_spacing, bool vr_mode = false)
inline virtual void setScreenshotMode(Point2 size) override
inline virtual void resetScreenshotMode() override
virtual void fillStatSettingsDialog(ViewportWindowStatSettingsDialog &dialog)
void onImguiDelayedCallback(void *user_data) override
void drawText(hdpi::Px x, hdpi::Px y, const String &text)
void paintRect()
void paintSelectionRect()
void processRectangularSelectionMouseMove(int mouse_x, int mouse_y)
void processMouseMoveInfluence(real &deltaX, real &deltaY, int mouse_x, int mouse_y)
void OnChangePosition()
void OnDestroy()
void OnChangeState()
void OnCameraChanged()
void setCameraViewText()
const char *viewportCommandToName(int id) const
int viewportNameToCommand(const char *name)
void clientToZeroLevelPlane(int x, int y, Point3 &world)
virtual void fillPopupMenu(PropPanel::IMenu &menu)
void fillStat3dStatSettings(ViewportWindowStatSettingsDialog &dialog)
void handleStat3dStatSettingsDialogChange(int pcb_id, bool value)
virtual bool canStartInteractionWithViewport()
bool canRouteMessagesToExternalEventHandler() const
void handleViewportAxisMouseLButtonDown()
void handleViewportAxisMouseLButtonUp()
void processViewportAxisCameraRotation(int mouse_x, int mouse_y)
void setViewportAxisTransitionEndDirection(const Point3 &forward, const Point3 &up)
void processCameraMouseMove(CCameraElem *camera_elem, int mouse_x, int mouse_y)
void processCameraMouseWheel(CCameraElem *camera_elem, int delta)
void processMaxCameraMouseMButtonDown(int mouse_x, int mouse_y)
void processMaxCameraMouseMButtonUp()
void processMaxCameraMouseMove(int mouse_x, int mouse_y, bool m_button_down)
void processMaxCameraMouseWheel(int multiplied_delta)
void processMouseLButtonPress(int mouse_x, int mouse_y)
void processMouseLButtonRelease(int mouse_x, int mouse_y)
void processMouseLButtonDoubleClick(int mouse_x, int mouse_y)
void processMouseMButtonPress(int mouse_x, int mouse_y)
void processMouseMButtonRelease(int mouse_x, int mouse_y)
void processMouseRButtonPress(int mouse_x, int mouse_y)
void processMouseRButtonRelease(int mouse_x, int mouse_y)
void processMouseMove(int mouse_x, int mouse_y)
void processMouseWheel(int mouse_x, int mouse_y, int multiplied_delta)
void *getMainHwnd()
void resizeViewportTexture()
Point3 getCameraPanAnchorPoint()
inline virtual BaseTexture *getDepthBuffer()

Methods to set / get viewport parameters.

virtual void setProjection(bool orthogonal, real fov, real near_plane, real far_plane) override

Set viewport projection parameters

Parameters:
  • orthogonal[in] - if true the view will be orthogonal, if false - perspective

  • fov[in] - camera’s Field Of View (in radians)

  • near_plane[in] - z-near, a distance to nearest visible parts of scene (all parts more close to camera will be invisible)

  • far_plane[in] - z-far, a distance to the farthest visible parts of scene (all parts more distant from camera will be invisible)

virtual void setFov(real fov) override

Set camera’s FOV (Field Of View).

Parameters:

fov[in] - camera’s angle of view (in radians)

virtual real getFov() override

Get camera’s FOV (Field Of View).

Returns:

fov (in radians)

virtual void setCameraDirection(const Point3 &forward, const Point3 &up) override

Set camera’s direction.

Parameters:
  • forward[in] - direction of camera’s view

  • up[in] - direction of camera’s top

virtual void setCameraPos(const Point3 &pos) override

Set camera’s position.

Parameters:

pos[in] - position

virtual void setCameraTransform(const TMatrix &tm) override

Set view matrix of the camera.

Parameters:

tm[in] - view matrix

virtual void setOrthogonalZoom(real zoom) override

Set zoom property for camera in orthogonal mode.

Parameters:

zoom[in] - zoom value

virtual void getCameraTransform(TMatrix &m) const override

Get view matrix of the camera.

Parameters:

m[out] - view matrix

virtual real getOrthogonalZoom() const override

Get zoom property for camera in orthogonal mode.

Returns:

zoom value

virtual bool isOrthogonal() const override

Tests whether camera is in orthogonal mode

Returns:

true if viewport is in orthogonal mode, false in other case

virtual bool isFlyMode() const override

Tests whether viewport is in “fly” mode

Returns:

true if viewport is in “fly” mode, false in other case

virtual void setCameraMode(bool camera_mode) override

Set camera’s mode (orthogonal/perspective).

Parameters:

camera_mode[in] - if true the view will be orthogonal, if false - perspective

virtual void setCameraViewProjection(const TMatrix &view, real fov) override

Set camera’s projection.

Parameters:
  • view[in] - view matrix

  • fov[in] - camera’s Field Of View

Methods to convert viewport coordinates from one coordinate system

to another.

void clientRectToWorld(Point3 *pt, Point3 *dirs, float fake_persp_side)

Convert coordinates of viewport vertices to world coordinates.

Parameters:
  • pt[out] - pointer to first element of array consisting of 4 components. World coordinates of viewport vertices.

  • dirs[out] - pointer to first element of array consisting of 2 components. World directions of viewport lines.

virtual void clientToWorld(const Point2 &screen, Point3 &world, Point3 &world_dir) override

Convert viewport screen coordinates to world coordinates.

Parameters:
  • screen[in] - screen coordinates

  • world[out] - world coordinates (on camera’s (lens’s) surface)

  • world_dir[out] - camera’s direction

virtual void worldToNDC(const Point3 &world, Point3 &ndc) const override

Convert viewport world coordinates to normal device coordinates.

Parameters:
  • world[in] - world coordinates

  • ndc[out] - normal device coordinates

virtual bool worldToClient(const Point3 &world, Point2 &screen, real *screen_z = NULL) override

Convert viewport world coordinates to screen coordinates.

Parameters:
  • world[in] - world coordinates

  • screen[out] - screen coordinates

  • screen_z[out] - the distance between camera and the world point, may be <0 if the world point is placed behind camera

Returns:

true if convertion successful, false in other case

virtual void clientToScreen(int &x, int &y) override

Convert viewport screen coordinates to application window screen coordinates.

Parameters:

x, y[inout] - x, y screen coordinates

virtual void screenToClient(int &x, int &y) override

Convert application window screen coordinates to viewport screen coordinates.

Parameters:

x, y[inout] - x, y screen coordinates

virtual void getViewportSize(int &x, int &y) override

Get dimensions of viewport in pixels

Parameters:

x, y[out] - x, y dimensions of viewport

virtual void switchCamera(unsigned int from, unsigned int to) override

Switch view of camera from view 1 to view 2. For example, switch camera from “Left” view to “Top” view

Parameters:
  • from[in] - “from” view

  • to[in] - “to” view

void getMenuAreaSize(hdpi::Px &w, hdpi::Px &h)

Get top-left menu area size.

inline bool isVisible() const
int getW() const
int getH() const
void getClientRect(EcRect &clientRect) const
virtual void captureMouse() override
virtual void releaseMouse() override

Viewport activity.

virtual void activate() override

Activate viewport.

virtual bool isActive() override

Tests whether viewport is active.

Returns:

true if viewport is active, false in other case

virtual real getLinearSizeSq(const Point3 &pos, real world_rad, int xy) override

Get square of visible radius of a circle

Parameters:
  • pos[in] - world coordinates of center of a circle

  • world_rad[in] - radius of a circle

  • xy[in] - 0-horizontal radius, 1-vertical radius (of ellipse)

Returns:

square of visible radius of a circle (ellipse)

Viewport redraw methods.

virtual void redrawClientRect() override

Redraw viewport as Dagor Engine object and CTL object.

virtual void invalidateCache() override

Redraw viewport.

virtual void enableCache(bool en) override

Enable / disable viewport cache.

Parameters:

en[in] - true to enable cache, false to disable

Start / stop drawing rectangular selection box.

User interface for editing

virtual void startRectangularSelection(int mx, int my, int type) override

Start drawing rectangular selection box.

Parameters:
  • mx, my[in] - starting point of selection box

  • type[in] - type of selection box

virtual bool endRectangularSelection(EcRect *result, int *type) override

End drawing rectangular selection box.

Parameters:
  • result[out] - pointer to CtlRect with coordinates of a selected area (upper left and lower bottom corners of area). May be NULL

  • type[out] - type of selection box

Returns:

true if selection successful, false if selection aborted

virtual void setViewProj() override

Set parameters (projection matrix, etc) of a videocard driver camera equal to parameters of viewport camera

virtual void zoomAndCenter(BBox3 &box) override

Zoom and center bounding box. Function centers and zooms bounding box to max visible size in viewport.

Parameters:

box[in] - bounding box (see #BBox3)

Load / save viewport settings.

virtual void load(const DataBlock &blk)

Load viewport settings from blk file.

Parameters:

blk[in] - Data Block that contains data to load (see #DataBlock)

virtual void save(DataBlock &blk) const

Save viewport settings to blk file.

Parameters:

blk[in] - Data Block that contains data to save (see #DataBlock)

void setZnearZfar(real zn, real zf, bool change_defaults)

Set z-near / z-far properties of viewport.

Parameters:
  • zn[in] - z-near, a distance to nearest visible parts of scene in viewport (all parts more close to camera will be invisible)

  • zf[in] - z-far, a distance to the farthest visible parts of scene in viewport (all parts more distant from camera will be invisible)

  • change_defaults[in] - true - set z-near/z-far as defaults for all viewports

virtual void getZnearZfar(real &zn, real &zf) const override

Get z-near / z-far values of viewport.

Parameters:
  • zn[in] - z-near, a distance to nearest visible parts of scene in viewport

  • zf[in] - z-far, a distance to the farthest visible parts of scene in viewport

Process custom cameras (if they exist).

void act(real dt)

For internal use in EditorCore.

inline void setCustomCameras(ICustomCameras *in_customCameras)

Set custom camera in viewport.

Parameters:

in_customCameras[in] - pointer to custom camera (see ICustomCameras). May be NULL to switch off cameras.

Public Functions

ViewportWindow()
~ViewportWindow()

Destructor.

virtual void init(IGenEventHandler *eh)

Initialize viewport.

virtual int handleCommand(int p1 = 0, int p2 = 0, int p3 = 0) override
int onMenuItemClick(unsigned id) override
virtual void setEventHandler(IGenEventHandler *eh) override

Set event handler of viewport. Viewport will send messages about its events to this event handler.

Parameters:

eh[in] - pointer to event handler

Public Members

int type
EcRect sel

Public Static Attributes

static bool showDagorUiCursor
static void (*render_viewport_frame)(ViewportWindow *vpw)
class ViewportWindowStatSettingsDialog : public PropPanel::DialogWindow

Public Functions

ViewportWindowStatSettingsDialog(ViewportWindow &_viewport, bool *_rootEnable, hdpi::Px width, hdpi::Px height)
void onPostEvent(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
PropPanel::TLeafHandle addGroup(int group, const char name[], bool enabled)
void addOption(PropPanel::TLeafHandle group, int id, const char name[], bool value)

Private Functions

Item *getGroupByHandle(PropPanel::TLeafHandle handle)
void setTreeNodeState(PropPanel::TLeafHandle node, bool item_enabled, bool parent_enabled)
void updateColors()
void onChange(int pcb_id, PropPanel::ContainerPropertyControl *panel) override

Private Members

bool *rootEnable
PropPanel::TLeafHandle root
PropPanel::ContainerPropertyControl *tree
dag::Vector<Item> m_options
eastl::vector_map<int, Item> m_groups
ViewportWindow &viewport
struct VpInfo
#include <ec_gizmofilter.h>

Public Members

Point2 center
Point2 ax
Point2 ay
Point2 az
class WorkspaceDialog : public PropPanel::DialogWindow
#include <ec_startDlg.h>

Public Functions

WorkspaceDialog(EditorStartDialog *esd, const char *caption, EditorWorkspace &wsp, bool is_editing)
bool onOk() override
inline bool onCancel() override
void onChange(int pcb_id, PropPanel::ContainerPropertyControl *panel) override
void onClick(int pcb_id, PropPanel::ContainerPropertyControl *panel) override

Protected Types

Values:

enumerator PID_COMMON_PARAMETERS_GRP
enumerator PID_WSP_NAME
enumerator PID_APP_FOLDER
enumerator PID_NEW_APPLICATION
enumerator PID_CUSTOM_PARAMETERS

Protected Attributes

EditorWorkspace &mWsp
bool mEditing
EditorStartDialog *mEsd
struct Workspaces
#include <ec_workspace.h>

Public Functions

inline Workspaces()

Public Members

DataBlock blk
StriMap<DataBlock*> names
struct WorldCursorParams
#include <ec_genappwnd.h>

Public Members

Point3 pt
Point3 norm
bool visible
bool xz_based
TEXTUREID texId
real size
struct WspLibData
#include <ec_workspace.h>

Public Members

String name
String fname
namespace AnimV20
namespace ddsx
namespace ec_camera_elem

Variables

InitOnDemand<FreeCameraElem> freeCameraElem
InitOnDemand<MaxCameraElem> maxCameraElem
InitOnDemand<FpsCameraElem> fpsCameraElem
InitOnDemand<TpsCameraElem> tpsCameraElem
InitOnDemand<CarCameraElem> carCameraElem
namespace editorcore_extapi

Functions

String make_full_start_path(const char *rel_path)

Variables

IDagorRender *dagRender
IDagorGeom *dagGeom
IDagorConsole *dagConsole
IDagorInput *dagInput
IDagorTools *dagTools
IDagorScene *dagScene
namespace GizmoSettings

Functions

void load(DataBlock &block)
void save(DataBlock &block)
void updateAxisColors()
void retrieveAxisColors(E3DCOLOR &colorX, E3DCOLOR &colorY, E3DCOLOR &colorZ)

Variables

int lineThickness = 2
float viewportGizmoScaleFactor = 1.0f
bool overrideColor[3] = {false, false, false}
E3DCOLOR axisColor[3]
namespace Outliner
namespace PropPanel
namespace sgg

Functions

void set_exe_path(const char path[])
const char *get_exe_path()
const char *get_exe_path_full()
namespace StaticSceneBuilder
file captureCursor.h

Functions

void capture_cursor(void *handle)

Capture mouse cursor and hold it inside main Editor window.

void release_cursor()

Release mouse cursor captured by capture_cursor().

void cursor_wrap(int &p1, int &p2, void *handle = NULL)

Wrap mouse cursor. The function wraps mouse cursor to opposite side of Editor’s main window when it reaches window border and continues moving.

Parameters:
  • p1, p2[in] - initial x,y coordinates

  • p1, p2[out] - final (wraped) x,y coordinates

void area_cursor_wrap(const EcRect &rc, int &p1, int &p2, int &wrapedX, int &wrapedY)

Wrap mouse cursor. The function wraps mouse cursor to opposite side of specified area when it reaches area border and continues moving.

Parameters:
  • rc[in] - area coordinates

  • p1, p2[in] - initial x,y coordinates

  • p1, p2[out] - final (wraped) x,y coordinates

  • wrapedX, wrapedY[out] - dX,dY increment storage. Used for accumulating cursor increments and creating objects with sizes greater than window size.

file ec_application_creator.h
#include <propPanel/commonWindow/dialogWindow.h>
file ec_brush.h
#include <util/dag_globDef.h>
#include <util/dag_simpleString.h>
#include <math/dag_math3d.h>
#include <math/dag_e3dColor.h>
file ec_brushfilter.h
file ec_camera_dlg.h
#include <util/dag_globDef.h>
#include <propPanel/commonWindow/dialogWindow.h>
file ec_camera_elem.h
#include <generic/dag_initOnDemand.h>
#include <propPanel/c_common.h>
file ec_cm.h

Enums

enum EditorCoreCM

Values:

enumerator CM_FILE
enumerator CM_FILE_NEW
enumerator CM_FILE_OPEN
enumerator CM_FILE_SAVE
enumerator CM_FILE_RECENT_BASE
enumerator CM_FILE_RECENT_LAST
enumerator CM_VIEWPORT_LAYOUT_4
enumerator CM_VIEWPORT_LAYOUT_2HOR
enumerator CM_VIEWPORT_LAYOUT_2VERT
enumerator CM_VIEWPORT_LAYOUT_1
enumerator CM_VIEW
enumerator CM_VIEW_PERSPECTIVE
enumerator CM_VIEW_FRONT
enumerator CM_VIEW_BACK
enumerator CM_VIEW_TOP
enumerator CM_VIEW_BOTTOM
enumerator CM_VIEW_LEFT
enumerator CM_VIEW_RIGHT
enumerator CM_VIEW_CUSTOM_ORTHOGONAL
enumerator CM_VIEW_CUSTOM_CAMERA
enumerator CM_VIEW_WIREFRAME
enumerator CM_VIEW_VIEWPORT_AXIS
enumerator CM_VIEW_EDGED
enumerator CM_VIEW_GIZMO
enumerator CM_VIEW_GRID_SHOW
enumerator CM_VIEW_GRID_INC_STEP
enumerator CM_VIEW_GRID_DEC_STEP
enumerator CM_VIEW_GRID_MOVE_SNAP
enumerator CM_VIEW_GRID_ANGLE_SNAP
enumerator CM_VIEW_GRID_SCALE_SNAP
enumerator CM_VIEW_SHOW_STATS
enumerator CM_VIEW_STAT3D_OPAQUE
enumerator CM_VIEW_STAT3D_COLOR_HISTORGAM
enumerator CM_VIEW_STAT3D_BRIGHTNESS_HISTORGAM
enumerator CM_GROUP_GRID
enumerator CM_GROUP_CLIPPING
enumerator CM_GROUP_STATS
enumerator CM_CAMERAS_FREE
enumerator CM_CAMERAS_FPS
enumerator CM_CAMERAS_TPS
enumerator CM_CAMERAS_CAR
enumerator CM_CAMERA_MOVE
enumerator CM_PLUGIN_FIRST_CAMERA
enumerator CM_PLUGIN_LAST_CAMERA
enumerator CM_OPTIONS
enumerator CM_OPTIONS_CAMERAS
enumerator CM_OPTIONS_GRID
enumerator CM_OPTIONS_SCREENSHOT
enumerator CM_OPTIONS_STAT_DISPLAY_SETTINGS
enumerator CM_TOOLS
enumerator CM_CREATE_SCREENSHOT
enumerator CM_CREATE_CUBE_SCREENSHOT
enumerator CM_CREATE_ORTHOGONAL_SCREENSHOT
enumerator CM_UPSCALE_HEIGHTMAP
enumerator CM_EXIT
enumerator CM_EDIT
enumerator CM_UNDO
enumerator CM_REDO
enumerator CM_SELECT_ALL
enumerator CM_DESELECT_ALL
enumerator CM_GIZMO_X
enumerator CM_GIZMO_Y
enumerator CM_GIZMO_Z
enumerator CM_GIZMO_BASIS
enumerator CM_GIZMO_CENTER
enumerator CM_ROTATE_CENTER_AND_OBJ
enumerator CM_ZOOM_AND_CENTER
enumerator CM_NAVIGATE
enumerator CM_STATS
enumerator CM_CHANGE_VIEWPORT
enumerator CM_CHANGE_FOV
enumerator CM_ENVIRONMENT_SETTINGS
enumerator CM_CONSOLE
enumerator CM_PALETTE
enumerator CM_VR_ENABLE
enumerator CM_THEME_TOGGLE
enumerator CM_STATS_SETTINGS_TREE
enumerator CM_STATS_SETTINGS_STAT3D_GROUP
enumerator CM_STATS_SETTINGS_STAT3D_ITEM0
enumerator CM_STATS_SETTINGS_STAT3D_ITEM_LAST
enumerator CM_STATS_SETTINGS_CAMERA_GROUP
enumerator CM_STATS_SETTINGS_CAMERA_POS
enumerator CM_STATS_SETTINGS_CAMERA_DIST
enumerator CM_STATS_SETTINGS_CAMERA_FOV
enumerator CM_STATS_SETTINGS_CAMERA_SPEED
enumerator CM_STATS_SETTINGS_CAMERA_TURBO_SPEED
enumerator CM_OBJED_FIRST
enumerator CM_OBJED_MODE_SELECT
enumerator CM_OBJED_MODE_MOVE
enumerator CM_OBJED_MODE_SURF_MOVE
enumerator CM_OBJED_MODE_ROTATE
enumerator CM_OBJED_MODE_SCALE
enumerator CM_OBJED_DROP
enumerator CM_OBJED_OBJPROP_PANEL
enumerator CM_OBJED_SELECT_BY_NAME
enumerator CM_OBJED_SELECT_FILTER
enumerator CM_OBJED_DELETE
enumerator CM_OBJED_CANCEL_GIZMO_TRANSFORM
enumerator CM_OBJED_LAST
enumerator CM_SAVE_ACTIVE_VIEW
enumerator CM_RESTORE_ACTIVE_VIEW
enumerator CM_SET_VIEWPORT_CLIPPING
enumerator CM_SET_DEFAULT_VIEWPORT_CLIPPING
enumerator CM__LAST_USED_BY_CORE
file ec_colors.h

Functions

const E3DCOLOR neutral_color (128, 160, 128, 255)
const E3DCOLOR selected_color (200, 200, 200, 255)
const E3DCOLOR higlighted_color (200, 128, 128, 255)
const E3DCOLOR higlighted_selected_color (255, 200, 200, 255)
file ec_decl.h

Variables

static constexpr unsigned HUID_IEditorCore = 0xB59C93E8u
static constexpr unsigned HUID_IRenderingService = 0x80C30E29u
static constexpr unsigned HUID_IHDRChangeSettingsClient = 0x006003ABu
file ec_genapp_ehfilter.h
file ec_genappwnd.h
#include <util/dag_string.h>
#include <generic/dag_tab.h>
#include <ioSys/dag_dataBlock.h>
#include <libTools/util/undo.h>
#include <math/dag_TMatrix.h>
#include <math/integer/dag_IPoint2.h>
#include <drv/3d/dag_resId.h>
#include <coolConsole/coolConsole.h>
#include <EASTL/unique_ptr.h>
file ec_geneditordata.h
#include <generic/dag_tab.h>
file ec_gizmofilter.h
#include <EASTL/unique_ptr.h>

Defines

GIZMO_PIXEL_WIDTH
AXIS_LEN_PIX
file ec_gizmoSettings.h
file ec_GizmoSettingsDialog.h
#include <propPanel/commonWindow/dialogWindow.h>
file ec_gridobject.h
#include <generic/dag_DObject.h>
#include <generic/dag_tab.h>
#include <math/dag_e3dColor.h>
#include <util/dag_globDef.h>
#include <propPanel/commonWindow/dialogWindow.h>
file ec_IEditorCore.h
#include <math/dag_e3dColor.h>
#include <math/dag_TMatrix.h>
#include <math/dag_bounds3.h>
#include <util/dag_globDef.h>
#include <util/dag_string.h>
#include <util/dag_safeArg.h>
#include <generic/dag_tab.h>
#include <generic/dag_smallTab.h>
#include <3d/dag_texMgr.h>
#include <libTools/dagFileRW/dagFileNode.h>
#include <libTools/dagFileRW/dagFileFormat.h>
#include <libTools/util/iLogWriter.h>
#include <libTools/staticGeom/staticGeometry.h>
#include <libTools/dagFileRW/textureNameResolver.h>
#include <libTools/dtx/dtx.h>
#include <osApiWrappers/dag_files.h>
#include <osApiWrappers/dag_direct.h>
#include <gameRes/dag_gameResources.h>
#include <shaders/dag_overrideStateId.h>
#include <sceneRay/dag_sceneRayDecl.h>
#include <stdarg.h>

Defines

DSA_OVERLOADS_PARAM_DECL

void addMessage(CoolConsole& con, MessageType type, const char *fmt, typesafe-var-args…)

DSA_OVERLOADS_PARAM_PASS
DSA_OVERLOADS_PARAM_DECL

void addMessage(CoolConsole& con, MessageType type, const char *fmt, typesafe-var-args…)

DSA_OVERLOADS_PARAM_PASS
file ec_IGizmoObject.h
#include <math/dag_math3d.h>
file ec_imguiInitialization.h
#include <imgui/imgui.h>
#include <math/dag_e3dColor.h>

Functions

void editor_core_initialize_input_handler()
void editor_core_initialize_imgui(const char *imgui_ini_path, int *dock_settings_version = nullptr)
void editor_core_save_imgui_settings(int dock_settings_version = 0)
void editor_core_save_dag_imgui_blk_settings(DataBlock &dst_blk)
void editor_core_load_dag_imgui_blk_settings(const DataBlock &src_blk)
void editor_core_load_imgui_theme(const char *fname)
E3DCOLOR editor_core_load_window_background_color(const char *theme_filename)
void editor_core_update_imgui_style_editor()
bool editor_core_imgui_begin(const char *name, bool *open, unsigned window_flags)

Variables

static constexpr int EDITOR_CORE_CURSOR_ADDITIONAL_CLICK = ImGuiMouseCursor_COUNT + 1
file ec_input.h
#include <math/integer/dag_IPoint2.h>

Enums

Values:

enumerator EC_MK_LBUTTON
enumerator EC_MK_RBUTTON
enumerator EC_MK_MBUTTON

Functions

IPoint2 ec_get_cursor_pos()
void ec_set_cursor_pos(IPoint2 pos)
void ec_show_cursor(bool show)
bool ec_set_busy(bool busy)
bool ec_get_busy()
bool ec_is_key_down(ImGuiKey key)
bool ec_is_alt_key_down()
bool ec_is_ctrl_key_down()
bool ec_is_shift_key_down()

Variables

static constexpr int EC_WHEEL_DELTA = 120
file ec_interface.h
#include <generic/dag_tab.h>
#include <math/dag_math3d.h>
#include <drv/3d/dag_resId.h>
#include <propPanel/control/menu.h>
#include <libTools/util/hdpiUtil.h>

Defines

EDITORCORE
RETURN_INTERFACE(huid, T)
file ec_interface_ex.h
#include <scene/dag_visibility.h>
file ec_IObjectCreator.h
#include <math/dag_TMatrix.h>
file ec_mainWindow.h
#include <EASTL/functional.h>
#include <EASTL/unique_ptr.h>
#include <dag/dag_vector.h>
#include <math/dag_e3dColor.h>
file ec_newProjDlg.h
#include <math/dag_math3d.h>
#include <util/dag_string.h>
#include <propPanel/commonWindow/dialogWindow.h>
file ec_object.h
#include <math/dag_math3d.h>
#include <util/dag_string.h>
#include <generic/dag_DObject.h>

Functions

template<class T>
T *RTTI_cast(EditableObject *source)
file ec_ObjectCreator.h
file ec_ObjectEditor.h
#include <propPanel/control/container.h>
#include <propPanel/control/panelWindow.h>
#include <propPanel/control/menu.h>
#include <util/dag_globDef.h>
#include <generic/dag_tab.h>
#include <generic/dag_ptrTab.h>
#include <generic/dag_smallTab.h>
#include <libTools/util/undo.h>
file ec_outliner.h
#include <propPanel/control/menu.h>
#include <propPanel/messageQueue.h>
#include <propPanel/propPanel.h>
#include <util/dag_string.h>
#include <EASTL/optional.h>
#include <EASTL/unique_ptr.h>

Typedefs

typedef void *ImTextureID
file ec_outlinerInterface.h
#include <generic/dag_span.h>
file ec_rect.h
file ec_rendEdObject.h
#include <libTools/util/undo.h>
#include <propPanel/control/container.h>

Defines

EO_IMPLEMENT_RTTI(CID)

Functions

bool is_sphere_hit_by_point(const Point3 &world_center, real world_rad, IGenViewportWnd *vp, int x, int y)
bool is_sphere_hit_by_rect(const Point3 &world_center, real world_rad, IGenViewportWnd *vp, const EcRect &rect)
real get_world_rad(const Point3 &size)

Variables

static const int CID_RenderableEditableObject = 0x6437E6D5
file ec_screenshot.h

Enums

enum class ScreenshotFormat

Values:

enumerator JPEG
enumerator TGA
enumerator PNG
enumerator TIFF
enumerator DDSX
enum class ScreenshotDlgMode

Values:

enumerator DA_EDITOR
enumerator ASSET_VIEWER

Functions

void saveScreenshotConfig(DataBlock &blk, const ScreenshotConfig &cfg)
void loadScreenshotConfig(const DataBlock &blk, ScreenshotConfig &cfg)
void saveCubeScreenshotConfig(DataBlock &blk, const ScreenshotConfig &cfg)
void loadCubeScreenshotConfig(const DataBlock &blk, ScreenshotConfig &cfg)
const char *getFileExtFromFormat(ScreenshotFormat fmt)
file ec_selwindow.h
#include <propPanel/commonWindow/dialogWindow.h>
#include <ioSys/dag_dataBlock.h>
#include <generic/dag_tab.h>
file ec_startDlg.h
#include <propPanel/commonWindow/dialogWindow.h>
#include <propPanel/messageQueue.h>

Enums

Values:

enumerator ID_START_DIALOG_COMBO
enumerator ID_START_DIALOG_ERROR_MESSAGE
enumerator ID_START_DIALOG_BUTTON_ADD
enumerator ID_START_DIALOG_BUTTON_EDIT
file ec_startup.h

Functions

void startup_editor_core_select_startup_scene()
void startup_editor_core_force_startup_scene_draw()
file ec_status_bar.h
#include <math/dag_math3d.h>
#include <util/dag_string.h>
file ec_viewportAxisId.h

Enums

enum class ViewportAxisId

Values:

enumerator None
enumerator X
enumerator Y
enumerator Z
enumerator NegativeX
enumerator NegativeY
enumerator NegativeZ
enumerator RotatorCircle
file ec_viewportSplitter.h
#include <math/dag_Point2.h>
#include <imgui/imgui.h>
#include <imgui/imgui_internal.h>

Functions

inline bool crosshair_splitter_behavior(const ImRect &bbHorizontal, const ImRect &bbVertical, ImGuiID id, float *newLeftWidth, float *newRightWidth, float *newTopHeight, float *newBottomHeight, float min_size, float hover_extend, float hover_visibility_delay, ImU32 bg_col)
inline void render_imgui_viewport_splitter(Point2 &viewport_split_ratio, const Point2 &region_available, float left_width, float right_width, float top_height, float bottom_height, float item_spacing)
file ec_ViewportWindow.h
#include <propPanel/control/menu.h>
#include <propPanel/messageQueue.h>
#include <EASTL/optional.h>
#include <3d/dag_textureIDHolder.h>
#include <util/dag_simpleString.h>
#include <util/dag_stdint.h>
#include <dag/dag_vector.h>
#include <math/dag_Quat.h>
#include <gui/dag_stdGuiRenderEx.h>

Typedefs

typedef unsigned int ImGuiID

Functions

void save_camera_objects(DataBlock &blk)

Save cameras properties to blk file.

Parameters:

blk[in] - Data Block that contains data to save (see #DataBlock)

void load_camera_objects(const DataBlock &blk)

Load cameras properties from blk file.

Parameters:

blk[in] - Data Block that contains data to load (see #DataBlock)

void show_camera_objects_config_dialog(void *parent)

Toggles the display of the Camera settings dialog for all cameras.

Parameters:

parent[in] - pointer to parent window

void close_camera_objects_config_dialog()

Closes and deallocates the Camera settings dialog.

void act_camera_objects_config_dialog()

Act (tick/update) camera settings dialog.

file ec_ViewportWindowStatSettingsDialog.h
#include <propPanel/commonWindow/dialogWindow.h>
#include <propPanel/c_common.h>
#include <dag/dag_vector.h>
#include <EASTL/vector_map.h>
file ec_wndGlobal.h
file ec_wndPublic.h
#include <libTools/util/hdpiUtil.h>

Typedefs

typedef unsigned int ImGuiID
typedef int ImGuiKeyChord

Enums

enum WindowSizeInit

Values:

enumerator WSI_NORMAL
enumerator WSI_MINIMIZED
enumerator WSI_MAXIMIZED
file ec_workspace.h
#include <generic/dag_tab.h>
#include <libTools/containers/dag_StrMap.h>
#include <ioSys/dag_dataBlock.h>
group EditorCore

Defines

EO_IMPLEMENT_RTTI_EX(id, BASECLS)

Helper macro for RTTI implementation. static DClassID getStaticClassId()

- Returns class ID

virtual bool

isSubOf(DClassID cid) - Returns true if tested object is of specified class or is derived from specified class,false

in other case

virtual DClassID

getClassId () - Returns class ID

group EditorBaseClasses
group AppWindow
group ViewPort
group EventHandler
group EditableObject
group Cameras
group Brush
group Gizmo
group Grid
group Log
group Misc
group SelectByName
group ObjectCreating