mirror of
https://github.com/leozide/leocad.git
synced 2026-09-11 09:04:06 +00:00
53 lines
2.7 KiB
C++
53 lines
2.7 KiB
C++
#pragma once
|
|
|
|
#include "lc_context.h"
|
|
|
|
class lcViewManipulator
|
|
{
|
|
public:
|
|
lcViewManipulator(lcView* View);
|
|
|
|
void DrawSelectMove(lcTrackButton TrackButton, lcTrackTool TrackTool, quint32 TrackToolSection);
|
|
void DrawRotate(lcTrackButton TrackButton, lcTrackTool TrackTool);
|
|
|
|
std::pair<lcTrackTool, quint32> UpdateSelectMove(lcTrackButton TrackButton);
|
|
lcTrackTool UpdateRotate();
|
|
|
|
static void CreateResources(lcContext* Context);
|
|
static void DestroyResources(lcContext* Context);
|
|
|
|
protected:
|
|
void DrawTrainTrack(lcPiece* Piece, lcContext* Context, lcTrackTool TrackTool, quint32 TrackToolSection);
|
|
std::tuple<lcTrackTool, quint32, float> UpdateSelectMoveTrainTrack(lcPiece* Piece, float OverlayScale, const lcVector3& Start, const lcVector3& End) const;
|
|
|
|
static bool IsTrackToolAllowed(lcTrackTool TrackTool, quint32 AllowedTransforms);
|
|
|
|
lcView* mView = nullptr;
|
|
|
|
static lcVertexBuffer mRotateMoveVertexBuffer;
|
|
static lcIndexBuffer mRotateMoveIndexBuffer;
|
|
|
|
static constexpr lcVector4 mColorXAxis = lcVector4(200.0f / 255.0f, 40.0f / 255.0f, 60.0f / 255.0f, 255.0f / 255.0f);
|
|
static constexpr lcVector4 mColorYAxis = lcVector4(120.0f / 255.0f, 200.0f / 255.0f, 20.0f / 255.0f, 255.0f / 255.0f);
|
|
static constexpr lcVector4 mColorZAxis = lcVector4( 70.0f / 255.0f, 130.0f / 255.0f, 240.0f / 255.0f, 255.0f / 255.0f);
|
|
static constexpr lcVector4 mColorXAxisSelected = lcVector4(219.0f / 255.0f, 72.0f / 255.0f, 89.0f / 255.0f, 255.0f / 255.0f);
|
|
static constexpr lcVector4 mColorYAxisSelected = lcVector4(145.0f / 255.0f, 233.0f / 255.0f, 37.0f / 255.0f, 255.0f / 255.0f);
|
|
static constexpr lcVector4 mColorZAxisSelected = lcVector4(118.0f / 255.0f, 162.0f / 255.0f, 244.0f / 255.0f, 255.0f / 255.0f);
|
|
|
|
static constexpr int mMoveIndexStart = 0;
|
|
static constexpr int mMoveIndexCount = 36;
|
|
static constexpr int mRotateIndexStart = mMoveIndexStart + mMoveIndexCount * 3;
|
|
static constexpr int mRotateIndexCount = 120;
|
|
static constexpr int mMovePlaneIndexStart = mRotateIndexStart + mRotateIndexCount * 3;
|
|
static constexpr int mMovePlaneIndexCount = 4;
|
|
static constexpr int mTrainTrackRotateIndexStart = mMovePlaneIndexStart + mMovePlaneIndexCount * 3;
|
|
static constexpr int mTrainTrackRotateIndexCount = 96;
|
|
static constexpr int mTrainTrackInsertIndexStart = mTrainTrackRotateIndexStart + mTrainTrackRotateIndexCount * 2;
|
|
static constexpr int mTrainTrackInsertIndexCount = 72;
|
|
static constexpr int mTrainTrackConnectionIndexStart = mTrainTrackInsertIndexStart + mTrainTrackInsertIndexCount;
|
|
static constexpr int mTrainTrackConnectionIndexCount = 36;
|
|
static constexpr int mIndexCount = mTrainTrackConnectionIndexStart + mTrainTrackConnectionIndexCount;
|
|
static const GLushort mRotateMoveIndices[mIndexCount];
|
|
static lcVector3 mRotateMoveVertices[51 + 138 + 10 + 74 + 28 + 24];
|
|
};
|