00001 //------------------------------------------------------------------------------ 00002 // This file is part of the OpenStructure project <www.openstructure.org> 00003 // 00004 // Copyright (C) 2008-2010 by the OpenStructure authors 00005 // 00006 // This library is free software; you can redistribute it and/or modify it under 00007 // the terms of the GNU Lesser General Public License as published by the Free 00008 // Software Foundation; either version 3.0 of the License, or (at your option) 00009 // any later version. 00010 // This library is distributed in the hope that it will be useful, but WITHOUT 00011 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00013 // details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with this library; if not, write to the Free Software Foundation, Inc., 00017 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 //------------------------------------------------------------------------------ 00019 #ifndef OST_COLOR_OPS_COLOR_OP_HH 00020 #define OST_COLOR_OPS_COLOR_OP_HH 00021 00022 #include <string> 00023 00024 #include <ost/mol/query_view_wrapper.hh> 00025 00026 #include <ost/gfx/gfx_object_fw.hh> 00027 #include <ost/gfx/module_config.hh> 00028 00029 #include <ost/info/info.hh> 00030 #include <ost/info/info_fw.hh> 00031 00032 /* 00033 Author: Stefan Scheuber 00034 */ 00035 00036 namespace ost { namespace gfx { 00037 00038 typedef enum { 00039 DETAIL_COLOR = 1, 00040 MAIN_COLOR = 2 00041 } ColorBit; 00042 00043 typedef unsigned char ColorMask; 00044 00045 class DLLEXPORT_OST_GFX ColorOp { 00046 public: 00047 ColorOp(); 00048 virtual ~ColorOp() {} 00049 ColorOp(const String& selection, int mask=DETAIL_COLOR|MAIN_COLOR); 00050 ColorOp(const mol::QueryViewWrapper& query_view, int mask=DETAIL_COLOR|MAIN_COLOR); 00051 virtual bool CanApplyTo(const GfxObjP& obj) const; 00052 virtual void ApplyTo(GfxObjP& obj) const; 00053 00054 ColorMask GetMask() const; 00055 00056 void SetMask(ColorMask mask); 00057 00058 virtual void SetSelection(const String& selection); 00059 virtual String GetSelection() const; 00060 00061 virtual bool IsSelectionOnly() const; 00062 virtual void SetView(const mol::EntityView& view); 00063 virtual mol::EntityView GetView() const; 00064 00065 virtual void ToInfo(info::InfoGroup& group) const; 00066 static gfx::ColorOp FromInfo(info::InfoGroup& group); 00067 private: 00068 mol::QueryViewWrapper query_view_; 00069 mol::EntityView view_; 00070 ColorMask mask_; 00071 }; 00072 00073 }} 00074 00075 #endif 00076
1.5.8