diff --git a/modules/gfx/src/color.cc b/modules/gfx/src/color.cc index c1da35d27c6984d71896b06d18a80f01883109da..45398f486a46a5e22ce1a9c2d12294fc04a15801 100644 --- a/modules/gfx/src/color.cc +++ b/modules/gfx/src/color.cc @@ -26,12 +26,12 @@ namespace ost { namespace gfx { -Color::Color(int code) +Color::Color(uint code) { - rgba[0]=static_cast<float>((code>>16)&0xff)/255.0; - rgba[1]=static_cast<float>((code>>8)&0xff)/255.0; - rgba[2]=static_cast<float>(code&0xff)/255.0; - rgba[3]=1.0; + rgba[0]=static_cast<float>((code>>24)&0xff)/255.0; + rgba[1]=static_cast<float>((code>>16)&0xff)/255.0; + rgba[2]=static_cast<float>((code>>8)&0xff)/255.0; + rgba[3]=static_cast<float>((code)&0xff)/255.0; } std::ostream& operator<<(std::ostream& s, const Color& c) diff --git a/modules/gfx/src/color.hh b/modules/gfx/src/color.hh index c659fe71c93c906bc3e37604fb1bf0727c40ee53..e28ed58c56a93c7f7ed171983416f7481a8cc4a5 100644 --- a/modules/gfx/src/color.hh +++ b/modules/gfx/src/color.hh @@ -51,21 +51,7 @@ public: rgba[3]=a; } - enum COLOR_NAME { - WHITE=0xffffff, - LIGHT_GREY=0xaaaaff, - GREY=0x999999ff, - DARK_GREY=0x333333ff, - BLACK=0x000000, - RED=0xff0000, - GREEN=0x00ff00, - BLUE=0x0000ff, - CYAN=0x00ffff, - MAGENTA=0xff00ff, - YELLOW=0xffff00 - }; - - Color(int hex_code); + explicit Color(uint hex_code); float& Red() {return rgba[0];} const float& Red() const {return rgba[0];} diff --git a/modules/gfx/src/map_iso.cc b/modules/gfx/src/map_iso.cc index 9de115593ccf84a1bc17fc641b639f66cdbe639d..ce9729c18c006a237b96541a5cb33b977e016371 100644 --- a/modules/gfx/src/map_iso.cc +++ b/modules/gfx/src/map_iso.cc @@ -59,38 +59,6 @@ namespace ost { namespace gfx { -MapIso::MapIso(const String& name, const img::MapHandle& mh, float level): - GfxObj(name), - original_mh_(mh), - downsampled_mh_(), - mh_(MapIso::DownsampleMap(mh)), - octree_(mh_), - stat_calculated_(false), - histogram_calculated_(false), - histogram_bin_count_(100), - level_(level), - normals_calculated_(false), - alg_(0), - smoothf_(0.2), - debug_octree_(false), - color_(Color::GREY) -{ - // TODO replace with def mat for this gfx obj type - if (mh_ != original_mh_) { - downsampled_mh_ = mh_; - } - octree_.Initialize(); - SetMatAmb(Color(0,0,0)); - SetMatDiff(Color(1,1,1)); - SetMatSpec(Color(0.1,0.1,0.1)); - SetMatShin(32); - mol::Transform tf=this->GetTF(); - tf.SetCenter(this->GetCenter()); - tf.SetTrans(this->GetCenter()); - this->SetTF(tf); - Rebuild(); -} - MapIso::MapIso(const String& name, const img::MapHandle& mh, float level, uint a): GfxObj(name), @@ -105,7 +73,7 @@ MapIso::MapIso(const String& name, const img::MapHandle& mh, normals_calculated_(false), alg_(a), debug_octree_(false), - color_(Color::GREY) + color_(1.0,1.0,1.0) { // TODO replace with def mat for this gfx obj type if (mh_ != original_mh_) { diff --git a/modules/gfx/src/map_iso.hh b/modules/gfx/src/map_iso.hh index 70319e7c7d310790d647d548902f1473da85f521..46923c7c7bc020b65015b5044dc47446f1d297c8 100644 --- a/modules/gfx/src/map_iso.hh +++ b/modules/gfx/src/map_iso.hh @@ -51,10 +51,7 @@ typedef boost::shared_ptr<MapIso> MapIsoP; /// \sa gfx::MapSlab class DLLEXPORT_OST_GFX MapIso: public GfxObj { public: - MapIso(const String& name, const img::MapHandle& mh,float level); - - MapIso(const String& name, const img::MapHandle& mh, - float level, uint a); + MapIso(const String& name, const img::MapHandle& mh,float level, uint a=0); virtual geom::AlignedCuboid GetBoundingBox() const; diff --git a/modules/gfx/src/primitives.cc b/modules/gfx/src/primitives.cc index b649c17f071fe5b17312bd8e96c14943b3486031..5c0d0650e3ee2785caa65e896276d2c300747308 100644 --- a/modules/gfx/src/primitives.cc +++ b/modules/gfx/src/primitives.cc @@ -30,8 +30,8 @@ namespace ost { namespace gfx { Primitive::Primitive(const String& name): - GfxNode(name), fill_(true), line_(true), outline_color_(gfx::Color::WHITE), - fill_color_(gfx::Color::LIGHT_GREY), line_width_(1.0) + GfxNode(name), fill_(true), line_(true), outline_color_(1.0,1.0,1.0), + fill_color_(0.8,0.8,0.8), line_width_(1.0) { }