diff --git a/src/Application/TextureHighlightWidget.cpp b/src/Application/TextureHighlightWidget.cpp new file mode 100644 index 0000000..8863dcc --- /dev/null +++ b/src/Application/TextureHighlightWidget.cpp @@ -0,0 +1,28 @@ +#include "TextureHighlightWidget.h" + +namespace ofx { +namespace piMapper { + +TextureHighlightWidget::TextureHighlightWidget(){ + _sm = 0; +} + +void TextureHighlightWidget::draw(){ + if(_sm == 0){ + return; + } + + if(_sm->getSelectedSurface() == 0){ + return; + } + + ofPolyline line = _sm->getSelectedSurface()->getTextureHitArea(); + ofPushStyle(); + ofSetLineWidth(2); + ofSetColor(0, 255, 255); + line.draw(); + ofPopStyle(); +} + +} // namespace piMapper +} // namespace ofx diff --git a/src/Application/TextureHighlightWidget.h b/src/Application/TextureHighlightWidget.h new file mode 100644 index 0000000..7328fd0 --- /dev/null +++ b/src/Application/TextureHighlightWidget.h @@ -0,0 +1,30 @@ +#pragma once + +#include "GuiBaseWidget.h" +#include "SurfaceManager.h" + +namespace ofx { +namespace piMapper { + +class TextureHighlightWidget : public GuiBaseWidget { + public: + TextureHighlightWidget(); + + void setup(){} + void update(){} + void draw(); + + void onMousePressed(ofMouseEventArgs & args){} + void onMouseReleased(ofMouseEventArgs & args){} + void onMouseDragged(ofMouseEventArgs & args){} + + bool inside(float x, float y){ return false; } + + void setSurfaceManager(SurfaceManager * sm){ _sm = sm; } + + private: + SurfaceManager * _sm; +}; + +} // namespace piMapper +} // namespace ofx \ No newline at end of file