3
* $Id: wrectangulo.h 3535 2011-03-18 17:57:05Z carlos $
6
* Copyright 2008-10 MetaEmotion S.L. All rights reserved.
7
* http://ginkgo-cadx.com
9
* This file is licensed under LGPL v3 license.
10
* See License.txt for details
15
#include <api/iwidgets.h>
21
//---------------------------------------------------------------------
23
class EXTAPI WRectanguloBuilder : public GNC::GCS::Widgets::IWidgetBuilder {
26
typedef GNC::GCS::Vector TVector;
27
typedef GNC::GCS::Eventos::EventoRaton TEventoRaton;
28
typedef GNC::GCS::Eventos::EventoTeclado TEventoTeclado;
29
typedef GNC::GCS::IWidgetsManager TWidgetsManager;
30
typedef GNC::GCS::Widgets::IWidget TWidget;
32
WRectanguloBuilder(TWidgetsManager* pManager, long gid);
34
~WRectanguloBuilder();
36
virtual void OnMouseEvents(TEventoRaton& event);
37
virtual void OnKeyEvents(TEventoTeclado& event);
39
virtual void Render(GNC::GCS::Contexto3D* c);
41
virtual GNC::GCS::Widgets::TipoCursor GetCursor();
50
TVector m_NodoMoviendose; // Cursor
51
TVector m_Start; // Origen del boundingBox
52
TVector m_Stop; // Destino del boundingBox
54
TVector m_Vertices[4]; // Vertices del bounding box.
60
//---------------------------------------------------------------------
62
class EXTAPI WRectangulo : public GNC::GCS::Widgets::IWidget {
64
//region "Constructor y destructor"
67
typedef GNC::GCS::Nodo TNodo;
68
typedef GNC::GCS::Vector TVector;
69
typedef GNC::GCS::Matriz TMatriz;
70
typedef GNC::GCS::Contexto3D TContexto;
71
typedef GNC::GCS::Eventos::EventoRaton TEventoRaton;
72
typedef GNC::GCS::Eventos::EventoTeclado TEventoTeclado;
74
WRectangulo(TVector bb[4], IWidgetsManager* pManager, long vid, const char* nombre, long gid);
80
//region "Interfaz especifica"
82
virtual void OnMouseEvents(TEventoRaton&);
84
virtual void OnKeyEvents(TEventoTeclado&);
86
virtual bool HitTest(float x, float y, float umbralCuadrado);
88
virtual bool HitTest(TVector* vertices, int numVertices);
90
virtual void Render(TContexto* c);
92
virtual void OffscreenRender(Contexto3D* c);
94
virtual bool SoportaAutoBorrado() const {
100
//region "Estado interno"
106
//region "Propiedades geometricas"
110
friend std::ostream& operator<<(std::ostream& out, const WRectangulo& w) {
111
out << "[ Rect = [ " << w.m_Vertices[0] << ", " << w.m_Vertices[1] << ", " << w.m_Vertices[2] << ", " << w.m_Vertices[3] << " ], GID=" << w.m_GID << ", TID=" << w.m_TID << " UID=" << w.m_UID << " ]";
115
friend std::ostream& operator<<(std::ostream& out, const WRectangulo* w) {
128
//region "Propiedades radiometricas"