2011-09-07 23:06:51 +02:00
|
|
|
#ifndef _PROJECT_H_
|
|
|
|
#define _PROJECT_H_
|
|
|
|
|
|
|
|
#include "object.h"
|
|
|
|
#include "opengl.h"
|
2013-08-16 01:43:18 +02:00
|
|
|
#include "lc_array.h"
|
2012-05-29 01:33:22 +02:00
|
|
|
#include "lc_math.h"
|
2013-08-09 06:57:18 +02:00
|
|
|
#include "lc_commands.h"
|
2014-02-10 01:13:41 +01:00
|
|
|
#include "str.h"
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
#define LC_DRAW_SNAP_A 0x0004 // Snap Angle
|
|
|
|
#define LC_DRAW_SNAP_X 0x0008 // Snap X
|
|
|
|
#define LC_DRAW_SNAP_Y 0x0010 // Snap Y
|
|
|
|
#define LC_DRAW_SNAP_Z 0x0020 // Snap Z
|
|
|
|
#define LC_DRAW_SNAP_XYZ (LC_DRAW_SNAP_X | LC_DRAW_SNAP_Y | LC_DRAW_SNAP_Z)
|
|
|
|
#define LC_DRAW_GLOBAL_SNAP 0x0040 // Don't allow relative snap.
|
|
|
|
#define LC_DRAW_LOCK_X 0x0100 // Lock X
|
|
|
|
#define LC_DRAW_LOCK_Y 0x0200 // Lock Y
|
|
|
|
#define LC_DRAW_LOCK_Z 0x0400 // Lock Z
|
|
|
|
#define LC_DRAW_LOCK_XYZ (LC_DRAW_LOCK_X | LC_DRAW_LOCK_Y | LC_DRAW_LOCK_Z)
|
|
|
|
#define LC_DRAW_MOVEAXIS 0x0800 // Move on fixed axis
|
|
|
|
//#define LC_DRAW_PREVIEW 0x1000 // Show piece position
|
|
|
|
#define LC_DRAW_CM_UNITS 0x2000 // Use centimeters
|
|
|
|
//#define LC_DRAW_3DMOUSE 0x4000 // Mouse moves in all directions
|
|
|
|
|
|
|
|
#define LC_SCENE_FOG 0x004 // Enable fog
|
|
|
|
#define LC_SCENE_BG 0x010 // Draw bg image
|
|
|
|
#define LC_SCENE_BG_TILE 0x040 // Tile bg image
|
|
|
|
#define LC_SCENE_FLOOR 0x080 // Render floor
|
|
|
|
#define LC_SCENE_GRADIENT 0x100 // Draw gradient
|
|
|
|
|
|
|
|
#define LC_HTML_SINGLEPAGE 0x01
|
|
|
|
#define LC_HTML_INDEX 0x02
|
|
|
|
#define LC_HTML_IMAGES 0x04
|
|
|
|
#define LC_HTML_LISTEND 0x08
|
|
|
|
#define LC_HTML_LISTSTEP 0x10
|
|
|
|
#define LC_HTML_HIGHLIGHT 0x20
|
|
|
|
//#define LC_HTML_HTMLEXT 0x40
|
|
|
|
//#define LC_HTML_LISTID 0x80
|
|
|
|
|
2013-08-17 00:39:47 +02:00
|
|
|
#define LC_SEL_NO_PIECES 0x001 // No pieces in the project
|
|
|
|
#define LC_SEL_PIECE 0x002 // piece selected
|
|
|
|
#define LC_SEL_CAMERA 0x004 // camera selected
|
|
|
|
#define LC_SEL_LIGHT 0x010 // light selected
|
|
|
|
#define LC_SEL_MULTIPLE 0x020 // multiple pieces selected
|
|
|
|
#define LC_SEL_UNSELECTED 0x040 // at least 1 piece unselected
|
|
|
|
#define LC_SEL_HIDDEN 0x080 // at least one piece hidden
|
|
|
|
#define LC_SEL_GROUP 0x100 // at least one piece selected is grouped
|
|
|
|
#define LC_SEL_FOCUSGROUP 0x200 // focused piece is grouped
|
|
|
|
#define LC_SEL_CANGROUP 0x400 // can make a new group
|
|
|
|
|
2013-08-09 06:57:18 +02:00
|
|
|
enum LC_NOTIFY
|
|
|
|
{
|
|
|
|
LC_CAPTURE_LOST
|
|
|
|
};
|
|
|
|
|
2014-02-10 01:13:41 +01:00
|
|
|
enum lcBackgroundType
|
|
|
|
{
|
|
|
|
LC_BACKGROUND_SOLID,
|
|
|
|
LC_BACKGROUND_GRADIENT,
|
|
|
|
LC_BACKGROUND_IMAGE
|
|
|
|
};
|
|
|
|
|
|
|
|
class lcModelProperties
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void LoadDefaults();
|
|
|
|
void SaveDefaults();
|
|
|
|
|
|
|
|
bool operator==(const lcModelProperties& Properties)
|
|
|
|
{
|
|
|
|
if (mName != Properties.mName || mAuthor != Properties.mAuthor ||
|
|
|
|
mDescription != Properties.mDescription || mComments != Properties.mComments)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (mBackgroundType != Properties.mBackgroundType || mBackgroundSolidColor != Properties.mBackgroundSolidColor ||
|
|
|
|
mBackgroundGradientColor1 != Properties.mBackgroundGradientColor1 || mBackgroundGradientColor2 != Properties.mBackgroundGradientColor2 ||
|
|
|
|
mBackgroundImage != Properties.mBackgroundImage || mBackgroundImageTile != Properties.mBackgroundImageTile)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (mFogEnabled != Properties.mFogEnabled || mFogDensity != Properties.mFogDensity ||
|
|
|
|
mFogColor != Properties.mFogColor || mAmbientColor != Properties.mAmbientColor)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
String mName;
|
|
|
|
String mAuthor;
|
|
|
|
String mDescription;
|
|
|
|
String mComments;
|
|
|
|
|
|
|
|
lcBackgroundType mBackgroundType;
|
|
|
|
lcVector3 mBackgroundSolidColor;
|
|
|
|
lcVector3 mBackgroundGradientColor1;
|
|
|
|
lcVector3 mBackgroundGradientColor2;
|
|
|
|
String mBackgroundImage;
|
|
|
|
bool mBackgroundImageTile;
|
|
|
|
|
|
|
|
bool mFogEnabled;
|
|
|
|
float mFogDensity;
|
|
|
|
lcVector3 mFogColor;
|
|
|
|
lcVector3 mAmbientColor;
|
|
|
|
};
|
|
|
|
|
2013-08-09 06:57:18 +02:00
|
|
|
enum LC_TRANSFORM_TYPE
|
|
|
|
{
|
|
|
|
LC_TRANSFORM_ABSOLUTE_TRANSLATION,
|
|
|
|
LC_TRANSFORM_RELATIVE_TRANSLATION,
|
|
|
|
LC_TRANSFORM_ABSOLUTE_ROTATION,
|
|
|
|
LC_TRANSFORM_RELATIVE_ROTATION
|
|
|
|
};
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2012-10-18 20:57:21 +02:00
|
|
|
enum LC_MOUSE_TRACK
|
2011-09-07 23:06:51 +02:00
|
|
|
{
|
2011-09-20 03:26:31 +02:00
|
|
|
LC_TRACK_NONE,
|
|
|
|
LC_TRACK_START_LEFT,
|
|
|
|
LC_TRACK_LEFT,
|
|
|
|
LC_TRACK_START_RIGHT,
|
|
|
|
LC_TRACK_RIGHT
|
2012-10-18 20:57:21 +02:00
|
|
|
};
|
2011-09-07 23:06:51 +02:00
|
|
|
|
|
|
|
// Mouse control overlays.
|
2012-07-31 07:27:40 +02:00
|
|
|
enum LC_OVERLAY_MODES
|
2011-09-07 23:06:51 +02:00
|
|
|
{
|
2012-07-31 07:27:40 +02:00
|
|
|
LC_OVERLAY_NONE,
|
|
|
|
LC_OVERLAY_MOVE_X,
|
|
|
|
LC_OVERLAY_MOVE_Y,
|
|
|
|
LC_OVERLAY_MOVE_Z,
|
|
|
|
LC_OVERLAY_MOVE_XY,
|
|
|
|
LC_OVERLAY_MOVE_XZ,
|
|
|
|
LC_OVERLAY_MOVE_YZ,
|
|
|
|
LC_OVERLAY_MOVE_XYZ,
|
|
|
|
LC_OVERLAY_ROTATE_X,
|
|
|
|
LC_OVERLAY_ROTATE_Y,
|
|
|
|
LC_OVERLAY_ROTATE_Z,
|
|
|
|
LC_OVERLAY_ROTATE_XY,
|
|
|
|
LC_OVERLAY_ROTATE_XZ,
|
|
|
|
LC_OVERLAY_ROTATE_YZ,
|
|
|
|
LC_OVERLAY_ROTATE_XYZ,
|
|
|
|
LC_OVERLAY_ZOOM,
|
|
|
|
LC_OVERLAY_PAN,
|
|
|
|
LC_OVERLAY_ROTATE_VIEW_X,
|
|
|
|
LC_OVERLAY_ROTATE_VIEW_Y,
|
|
|
|
LC_OVERLAY_ROTATE_VIEW_Z,
|
2013-08-09 06:57:18 +02:00
|
|
|
LC_OVERLAY_ROTATE_VIEW_XYZ
|
2012-07-31 07:27:40 +02:00
|
|
|
};
|
2011-09-07 23:06:51 +02:00
|
|
|
|
|
|
|
class Piece;
|
|
|
|
class Camera;
|
|
|
|
class Light;
|
|
|
|
class Group;
|
|
|
|
class Terrain;
|
|
|
|
class PieceInfo;
|
|
|
|
class View;
|
|
|
|
class Image;
|
|
|
|
class TexFont;
|
|
|
|
|
|
|
|
// Undo support
|
|
|
|
|
2012-03-21 02:54:03 +01:00
|
|
|
#include "lc_file.h"
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2012-03-21 02:54:03 +01:00
|
|
|
struct LC_UNDOINFO
|
2011-09-07 23:06:51 +02:00
|
|
|
{
|
2012-03-23 00:44:56 +01:00
|
|
|
lcMemFile file;
|
2011-09-07 23:06:51 +02:00
|
|
|
char strText[21];
|
|
|
|
LC_UNDOINFO* pNext;
|
2013-08-09 06:57:18 +02:00
|
|
|
LC_UNDOINFO() { pNext = NULL; }
|
2012-03-21 02:54:03 +01:00
|
|
|
};
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2012-03-23 00:44:56 +01:00
|
|
|
struct LC_FILEENTRY
|
|
|
|
{
|
|
|
|
lcMemFile File;
|
|
|
|
char FileName[LC_MAXPATH];
|
|
|
|
};
|
|
|
|
|
2013-01-24 00:56:34 +01:00
|
|
|
struct lcPiecesUsedEntry
|
|
|
|
{
|
|
|
|
PieceInfo* Info;
|
|
|
|
int ColorIndex;
|
|
|
|
int Count;
|
|
|
|
};
|
|
|
|
|
2013-08-09 06:57:18 +02:00
|
|
|
struct lcSearchOptions
|
|
|
|
{
|
|
|
|
bool MatchInfo;
|
|
|
|
bool MatchColor;
|
|
|
|
bool MatchName;
|
|
|
|
PieceInfo* Info;
|
|
|
|
int ColorIndex;
|
|
|
|
char Name[256];
|
|
|
|
};
|
|
|
|
|
|
|
|
enum lcObjectProperty
|
|
|
|
{
|
|
|
|
LC_PART_POSITION,
|
|
|
|
LC_PART_ROTATION,
|
|
|
|
LC_PART_SHOW,
|
|
|
|
LC_PART_HIDE,
|
|
|
|
LC_PART_COLOR,
|
|
|
|
LC_PART_ID,
|
|
|
|
LC_CAMERA_POSITION,
|
|
|
|
LC_CAMERA_TARGET,
|
|
|
|
LC_CAMERA_UP,
|
|
|
|
LC_CAMERA_FOV,
|
|
|
|
LC_CAMERA_NEAR,
|
|
|
|
LC_CAMERA_FAR,
|
|
|
|
LC_CAMERA_NAME
|
|
|
|
};
|
|
|
|
|
|
|
|
enum LC_ACTIONS
|
|
|
|
{
|
|
|
|
LC_ACTION_INSERT,
|
|
|
|
LC_ACTION_LIGHT,
|
|
|
|
LC_ACTION_SPOTLIGHT,
|
|
|
|
LC_ACTION_CAMERA,
|
|
|
|
LC_ACTION_SELECT,
|
|
|
|
LC_ACTION_MOVE,
|
|
|
|
LC_ACTION_ROTATE,
|
|
|
|
LC_ACTION_ERASER,
|
|
|
|
LC_ACTION_PAINT,
|
|
|
|
LC_ACTION_ZOOM,
|
|
|
|
LC_ACTION_PAN,
|
|
|
|
LC_ACTION_ROTATE_VIEW,
|
|
|
|
LC_ACTION_ROLL,
|
|
|
|
LC_ACTION_ZOOM_REGION
|
|
|
|
};
|
|
|
|
|
2011-09-07 23:06:51 +02:00
|
|
|
class Project
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Project();
|
|
|
|
~Project();
|
|
|
|
|
|
|
|
public:
|
|
|
|
bool IsModified()
|
|
|
|
{ return m_bModified; }
|
|
|
|
|
|
|
|
unsigned char GetLastStep();
|
|
|
|
unsigned short GetCurrentTime ()
|
2014-01-30 04:13:34 +01:00
|
|
|
{ return m_nCurStep; }
|
2013-08-09 06:57:18 +02:00
|
|
|
void SetCurrentTime(unsigned short Time)
|
|
|
|
{
|
2014-01-30 04:13:34 +01:00
|
|
|
m_nCurStep = (unsigned char)Time;
|
2013-08-09 06:57:18 +02:00
|
|
|
CalculateStep();
|
|
|
|
}
|
2011-09-07 23:06:51 +02:00
|
|
|
void SetCurrentPiece(PieceInfo* pInfo)
|
|
|
|
{ m_pCurPiece = pInfo; }
|
2014-02-10 01:13:41 +01:00
|
|
|
float* GetBackgroundColor() // todo: remove
|
|
|
|
{ return mProperties.mBackgroundSolidColor; }
|
2011-09-13 07:38:22 +02:00
|
|
|
unsigned long GetSnap() const
|
|
|
|
{ return m_nSnap; }
|
2011-09-07 23:06:51 +02:00
|
|
|
int GetOverlayMode() const
|
|
|
|
{ return m_OverlayMode; }
|
2012-02-10 00:51:14 +01:00
|
|
|
void GetSnapIndex(int* SnapXY, int* SnapZ, int* SnapAngle) const;
|
2013-08-09 06:57:18 +02:00
|
|
|
void GetSnapText(char* SnapXY, char* SnapZ, char* SnapAngle) const;
|
2011-09-07 23:06:51 +02:00
|
|
|
void GetSnapDistance(float* SnapXY, float* SnapZ) const;
|
|
|
|
void GetTimeRange(int* from, int* to)
|
|
|
|
{
|
2014-01-30 04:13:34 +01:00
|
|
|
*from = m_nCurStep;
|
|
|
|
*to = 255;
|
2011-09-07 23:06:51 +02:00
|
|
|
}
|
|
|
|
|
2012-05-29 01:33:22 +02:00
|
|
|
void ConvertToUserUnits(lcVector3& Value) const;
|
|
|
|
void ConvertFromUserUnits(lcVector3& Value) const;
|
2011-09-07 23:06:51 +02:00
|
|
|
|
|
|
|
void UpdateInterface();
|
|
|
|
void SetPathName (const char* lpszPathName, bool bAddToMRU);
|
|
|
|
void SetTitle (const char* lpszTitle);
|
|
|
|
|
|
|
|
public:
|
2014-02-10 01:13:41 +01:00
|
|
|
void DeleteContents(bool bUndo);
|
2011-09-07 23:06:51 +02:00
|
|
|
void LoadDefaults(bool cameras);
|
|
|
|
void BeginPieceDrop(PieceInfo* Info);
|
2013-08-09 06:57:18 +02:00
|
|
|
void OnPieceDropMove(int x, int y);
|
|
|
|
void EndPieceDrop(bool Accept);
|
2012-01-28 03:10:19 +01:00
|
|
|
void BeginColorDrop();
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2013-08-16 01:43:18 +02:00
|
|
|
void GetPiecesUsed(lcArray<lcPiecesUsedEntry>& PiecesUsed) const;
|
2011-09-07 23:06:51 +02:00
|
|
|
void CreateImages(Image* images, int width, int height, unsigned short from, unsigned short to, bool hilite);
|
2011-09-20 03:26:31 +02:00
|
|
|
void Render(View* view, bool bToMemory);
|
2011-09-07 23:06:51 +02:00
|
|
|
void CheckAutoSave();
|
2012-05-29 01:33:22 +02:00
|
|
|
bool GetSelectionCenter(lcVector3& Center) const;
|
|
|
|
bool GetFocusPosition(lcVector3& Position) const;
|
2011-09-07 23:06:51 +02:00
|
|
|
Object* GetFocusObject() const;
|
|
|
|
Group* AddGroup (const char* name, Group* pParent, float x, float y, float z);
|
2012-08-13 02:28:35 +02:00
|
|
|
void TransformSelectedObjects(LC_TRANSFORM_TYPE Type, const lcVector3& Transform);
|
2013-08-09 06:57:18 +02:00
|
|
|
void ModifyObject(Object* Object, lcObjectProperty Property, void* Value);
|
|
|
|
void ZoomActiveView(int Amount);
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2011-09-17 01:59:55 +02:00
|
|
|
void AddView(View* view);
|
|
|
|
void RemoveView(View* view);
|
|
|
|
void UpdateAllViews();
|
2011-09-20 03:26:31 +02:00
|
|
|
bool SetActiveView(View* view);
|
2012-02-08 02:48:46 +01:00
|
|
|
View* GetActiveView() const
|
|
|
|
{
|
|
|
|
return m_ActiveView;
|
|
|
|
}
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2012-08-22 03:13:32 +02:00
|
|
|
// Objects
|
2014-04-10 06:46:48 +02:00
|
|
|
lcArray<Piece*> mPieces;
|
2013-08-16 01:43:18 +02:00
|
|
|
lcArray<Camera*> mCameras;
|
2014-04-09 00:34:50 +02:00
|
|
|
lcArray<Light*> mLights;
|
2012-08-22 03:13:32 +02:00
|
|
|
Group* m_pGroups;
|
|
|
|
Terrain* m_pTerrain;
|
|
|
|
|
2011-09-07 23:06:51 +02:00
|
|
|
char m_strTitle[LC_MAXPATH];
|
|
|
|
char m_strPathName[LC_MAXPATH];
|
2013-08-09 06:57:18 +02:00
|
|
|
bool m_bModified;
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2013-08-09 06:57:18 +02:00
|
|
|
protected:
|
2011-09-17 01:59:55 +02:00
|
|
|
View* m_ActiveView;
|
2013-08-16 01:43:18 +02:00
|
|
|
lcArray<View*> m_ViewList;
|
2011-09-07 23:06:51 +02:00
|
|
|
|
|
|
|
// Piece library
|
|
|
|
TexFont* m_pScreenFont;
|
|
|
|
|
|
|
|
// Undo support
|
|
|
|
LC_UNDOINFO* m_pUndoList;
|
|
|
|
LC_UNDOINFO* m_pRedoList;
|
|
|
|
bool m_bUndoOriginal;
|
|
|
|
void CheckPoint (const char* text);
|
|
|
|
|
|
|
|
void AddPiece(Piece* pPiece);
|
|
|
|
void RemovePiece(Piece* pPiece);
|
|
|
|
bool RemoveSelectedObjects();
|
2012-06-16 02:17:52 +02:00
|
|
|
void GetPieceInsertPosition(Piece* OffsetPiece, lcVector3& Position, lcVector4& Rotation);
|
|
|
|
void GetPieceInsertPosition(View* view, int MouseX, int MouseY, lcVector3& Position, lcVector4& Orientation);
|
2012-01-30 08:31:29 +01:00
|
|
|
Object* FindObjectFromPoint(View* view, int x, int y, bool PiecesOnly = false);
|
2013-08-16 01:43:18 +02:00
|
|
|
void FindObjectsInBox(float x1, float y1, float x2, float y2, lcArray<Object*>& Objects);
|
2011-09-07 23:06:51 +02:00
|
|
|
void SelectAndFocusNone(bool bFocusOnly);
|
|
|
|
void CalculateStep();
|
2013-12-19 14:41:49 +01:00
|
|
|
static int InstanceOfName(const String& existingString, const String& candidateString, String& baseNameOut );
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2013-08-09 06:57:18 +02:00
|
|
|
void FindPiece(bool FindFirst, bool SearchForward);
|
|
|
|
lcSearchOptions mSearchOptions;
|
|
|
|
|
2011-09-07 23:06:51 +02:00
|
|
|
// Movement.
|
2012-08-13 02:28:35 +02:00
|
|
|
bool MoveSelectedObjects(lcVector3& Move, lcVector3& Remainder, bool Snap, bool Lock);
|
|
|
|
bool RotateSelectedObjects(lcVector3& Delta, lcVector3& Remainder, bool Snap, bool Lock);
|
2012-06-16 02:17:52 +02:00
|
|
|
void SnapVector(lcVector3& Delta) const
|
2011-09-07 23:06:51 +02:00
|
|
|
{
|
2012-06-16 02:17:52 +02:00
|
|
|
lcVector3 Dummy;
|
2011-09-07 23:06:51 +02:00
|
|
|
SnapVector(Delta, Dummy);
|
|
|
|
}
|
2012-06-16 02:17:52 +02:00
|
|
|
void SnapVector(lcVector3& Delta, lcVector3& Leftover) const;
|
|
|
|
void SnapRotationVector(lcVector3& Delta, lcVector3& Leftover) const;
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2012-01-30 08:31:29 +01:00
|
|
|
// Rendering functions.
|
2011-09-20 03:26:31 +02:00
|
|
|
void RenderBackground(View* view);
|
2012-01-28 02:05:23 +01:00
|
|
|
void RenderScenePieces(View* view);
|
|
|
|
void RenderSceneObjects(View* view);
|
|
|
|
void RenderViewports(View* view);
|
|
|
|
void RenderOverlays(View* view);
|
2011-09-20 03:26:31 +02:00
|
|
|
|
2011-09-07 23:06:51 +02:00
|
|
|
void RenderInitialize();
|
2013-08-09 06:57:18 +02:00
|
|
|
void CreateHTMLPieceList(FILE* f, int nStep, bool bImages, const char* ext);
|
|
|
|
void Export3DStudio();
|
2013-08-17 03:35:02 +02:00
|
|
|
void ExportPOVRay(lcFile& File);
|
2012-12-13 01:20:40 +01:00
|
|
|
void ZoomExtents(int FirstView, int LastView);
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2012-03-23 00:44:56 +01:00
|
|
|
lcFile* m_pTrackFile;
|
2011-09-07 23:06:51 +02:00
|
|
|
bool m_bTrackCancel;
|
|
|
|
int m_nTracking;
|
|
|
|
int m_nDownX;
|
|
|
|
int m_nDownY;
|
|
|
|
float m_fTrack[3];
|
|
|
|
int m_nMouse;
|
2012-06-16 02:17:52 +02:00
|
|
|
lcVector3 m_MouseSnapLeftover;
|
|
|
|
lcVector3 m_MouseTotalDelta;
|
2011-09-07 23:06:51 +02:00
|
|
|
|
|
|
|
int m_OverlayMode;
|
|
|
|
bool m_OverlayActive;
|
2012-05-29 01:33:22 +02:00
|
|
|
lcVector3 m_OverlayCenter;
|
|
|
|
lcVector3 m_OverlayTrackStart;
|
|
|
|
lcVector3 m_OverlayDelta;
|
2012-02-01 03:08:30 +01:00
|
|
|
void MouseUpdateOverlays(View* view, int x, int y);
|
2012-07-31 07:27:40 +02:00
|
|
|
void ActivateOverlay(View* view, int Action, int OverlayMode);
|
2011-09-07 23:06:51 +02:00
|
|
|
void UpdateOverlayScale();
|
|
|
|
|
|
|
|
bool StopTracking(bool bAccept);
|
|
|
|
void StartTracking(int mode);
|
|
|
|
void UpdateSelection();
|
|
|
|
void RemoveEmptyGroups();
|
|
|
|
|
|
|
|
public:
|
2013-08-09 06:57:18 +02:00
|
|
|
void OnLeftButtonDown(View* view);
|
|
|
|
void OnLeftButtonUp(View* view);
|
|
|
|
void OnLeftButtonDoubleClick(View* view);
|
|
|
|
void OnMiddleButtonDown(View* view);
|
|
|
|
void OnMiddleButtonUp(View* view);
|
|
|
|
void OnRightButtonDown(View* view);
|
|
|
|
void OnRightButtonUp(View* view);
|
|
|
|
void OnMouseMove(View* view);
|
|
|
|
void OnMouseWheel(View* view, float Direction);
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2012-07-31 07:27:40 +02:00
|
|
|
void SetAction(int Action);
|
|
|
|
int GetCurAction() const
|
|
|
|
{
|
|
|
|
return m_nCurAction;
|
|
|
|
}
|
|
|
|
int GetAction() const;
|
|
|
|
|
2011-09-07 23:06:51 +02:00
|
|
|
void HandleNotify(LC_NOTIFY id, unsigned long param);
|
2013-08-09 06:57:18 +02:00
|
|
|
void HandleCommand(LC_COMMANDS id);
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2014-02-10 01:13:41 +01:00
|
|
|
lcuint32 m_nSnap;
|
|
|
|
|
2011-09-07 23:06:51 +02:00
|
|
|
protected:
|
|
|
|
// State variables
|
2013-08-09 06:57:18 +02:00
|
|
|
int mTransformType;
|
2012-01-28 03:10:19 +01:00
|
|
|
int m_nCurAction;
|
2011-09-07 23:06:51 +02:00
|
|
|
PieceInfo* m_pCurPiece;
|
2013-08-09 06:57:18 +02:00
|
|
|
PieceInfo* mDropPiece;
|
2011-09-07 23:06:51 +02:00
|
|
|
bool m_bAddKeys;
|
|
|
|
unsigned char m_nCurStep;
|
2012-03-23 00:44:56 +01:00
|
|
|
|
|
|
|
lcuint16 m_nMoveSnap;
|
|
|
|
lcuint16 m_nAngleSnap;
|
2011-09-07 23:06:51 +02:00
|
|
|
char m_strFooter[256];
|
|
|
|
char m_strHeader[256];
|
|
|
|
|
2014-02-10 01:13:41 +01:00
|
|
|
lcModelProperties mProperties;
|
|
|
|
|
2012-10-12 20:21:45 +02:00
|
|
|
lcTexture* m_pBackground;
|
2013-08-31 23:58:47 +02:00
|
|
|
lcTexture* mGridTexture;
|
2011-09-07 23:06:51 +02:00
|
|
|
|
|
|
|
protected:
|
2013-08-09 06:57:18 +02:00
|
|
|
bool DoSave(const char* FileName);
|
2012-03-23 00:44:56 +01:00
|
|
|
bool FileLoad(lcFile* file, bool bUndo, bool bMerge);
|
|
|
|
void FileSave(lcFile* file, bool bUndo);
|
2013-08-16 01:43:18 +02:00
|
|
|
void FileReadLDraw(lcFile* file, const lcMatrix44& CurrentTransform, int* nOk, int DefColor, int* nStep, lcArray<LC_FILEENTRY*>& FileArray);
|
|
|
|
void FileReadMPD(lcFile& MPD, lcArray<LC_FILEENTRY*>& FileArray) const;
|
2011-09-07 23:06:51 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
bool OnNewDocument();
|
|
|
|
bool OnOpenDocument(const char* FileName);
|
|
|
|
bool OpenProject(const char* FileName);
|
|
|
|
bool SaveModified();
|
2013-08-09 06:57:18 +02:00
|
|
|
void SetModifiedFlag(bool Modified);
|
2011-09-07 23:06:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _PROJECT_H_
|