!XT (Code) Update copyright headers in Code/Sandbox.
[CRYENGINE.git] / Code / Sandbox / Plugins / CryDesigner / Tools / Shape / CurveTool.h
blob37ed5957a847b3e35ae6d7c145fc7fe333df17ca
1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
3 #pragma once
5 #include "PolylineTool.h"
7 namespace Designer
9 struct CurveParameter
11 CurveParameter() :
12 m_NumOfSubdivision(kDefaultSubdivisionNum)
16 void Serialize(Serialization::IArchive& ar)
18 ar(SUBDIVISION_RANGE(m_NumOfSubdivision), "SubdivisionCount", "Subdivision Count");
21 int m_NumOfSubdivision;
24 class CurveTool : public PolylineTool
26 public:
28 CurveTool(EDesignerTool tool) :
29 PolylineTool(tool),
30 m_ArcState(eArcState_ChooseFirstPoint)
34 virtual ~CurveTool(){}
36 void Leave();
37 bool OnLButtonDown(CViewport* view, UINT nFlags, CPoint point) { return true; }
38 bool OnLButtonUp(CViewport* view, UINT nFlags, CPoint point);
39 bool OnMouseMove(CViewport* view, UINT nFlags, CPoint point);
40 void Display(DisplayContext& dc);
41 bool OnKeyDown(CViewport* view, uint32 nChar, uint32 nRepCnt, uint32 nFlags);
43 bool IsPhaseFirstStepOnPrimitiveCreation() const override;
44 void Serialize(Serialization::IArchive& ar) override;
46 protected:
47 void PrepareArcSpots(CViewport* view, UINT nFlags, CPoint point);
49 enum EDrawingArcState
51 eArcState_ChooseFirstPoint,
52 eArcState_ChooseLastPoint,
53 eArcState_ControlMiddlePoint
56 ELineState m_LineState;
57 EDrawingArcState m_ArcState;
58 Spot m_LastSpot;
60 CurveParameter m_CurveParameter;