BALL  1.4.1
modifyRepresentationDialog.h
Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 
00005 #ifndef BALL_VIEW_DIALOGS_MODIFYSURFACEDIALOG_H
00006 #define BALL_VIEW_DIALOGS_MODIFYSURFACEDIALOG_H
00007 
00008 #ifndef BALL_COMMON_GLOBAL_H
00009 # include <BALL/COMMON/global.h>
00010 #endif
00011 
00012 #ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
00013 # include <BALL/VIEW/DATATYPE/colorRGBA.h>
00014 #endif
00015 
00016 #ifndef BALL_VIEW_PRIMITIVES_MESH_H
00017 # include <BALL/VIEW/PRIMITIVES/mesh.h>
00018 #endif
00019 
00020 #ifndef BALL_VIEW_KERNEL_REPRESENTATION_H
00021 # include <BALL/VIEW/KERNEL/representation.h>
00022 #endif
00023 
00024 #ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
00025 # include <BALL/VIEW/KERNEL/modularWidget.h>
00026 #endif
00027 
00028 #ifndef BALL_DATATYPE_REGULARDATA3D
00029 # include <BALL/DATATYPE/regularData3D.h>
00030 #endif 
00031 
00032 #ifndef BALL_DATATYPE_HASHGRID_H
00033 # include <BALL/DATATYPE/hashGrid.h>
00034 #endif
00035 
00036 #ifndef BALL_VIEW_DIALOG_MATERIALSETTINGS_H
00037 # include <BALL/VIEW/DIALOGS/materialSettings.h>
00038 #endif
00039 
00040 #include <BALL/VIEW/UIC/ui_modifyRepresentationDialog.h>
00041 
00042 namespace BALL
00043 {
00044   namespace VIEW
00045   {
00051     class BALL_VIEW_EXPORT ModifyRepresentationDialog 
00052       : public QDialog,
00053         public Ui_ModifyRepresentationDialogData,
00054         public ModularWidget
00055     { 
00056       Q_OBJECT
00057 
00058       public:
00059 
00060       BALL_EMBEDDABLE(ModifyRepresentationDialog, ModularWidget)
00061 
00062       
00063       ModifyRepresentationDialog(QWidget* parent = 0, const char* name = "ModifyRepresentationDialog", 
00064                                  bool modal = FALSE, Qt::WFlags fl = 0);
00065 
00067       ~ModifyRepresentationDialog();
00068           
00070       virtual void onNotify(Message *message);
00071 
00073       void setRepresentation(Representation* rep);
00074 
00076       void setGrid(RegularData3D* grid);
00077           
00079       void setMinValue(float value);
00080           
00082       void setMaxValue(float value);
00083           
00085       void setMidValue(float value);
00086 
00088       void setSplitRadius(float distance);
00089 
00091       void setMode(Position pos);
00092         
00093       public slots:
00094       
00095       void accept();
00096       void tabChanged();    
00097       void autoScale();
00098       void choosePressed();
00099       void gridSelected();
00100       void show();
00101       void applySplit();
00102 
00103       protected slots:
00104 
00105       void customColorTransparencyChanged();
00106       void changeDrawingModeTransparencyChanged();
00107       void splitMethodChanged();
00108 
00109       protected:
00110 
00111       ModifyRepresentationDialog(const ModifyRepresentationDialog& dialog);
00112 
00113       typedef HashGrid3<const Atom*>  AtomGrid;
00114       typedef HashGridBox3<const Atom*> AtomBox;
00115       void colorByCustomColor_();
00116       bool colorByGrid_();
00117       bool insertGrid_(RegularData3D& grid, const String& name);
00118       void removeGrid_(RegularData3D& grid);
00119       void invalidateGrid_();
00120       void invalidateMesh_();
00121       void changeDrawingMode_();
00122       void checkApplyButton_();
00123 
00124       void calculateIncludedVertices_(vector<bool>& include_vertex, const Mesh& org_mesh, HashSet<const Composite*>& roots);
00125       inline bool checkInclude_(const AtomGrid& atom_grid, const Vector3& point) const;
00126 
00127       RegularData3D* grid_;
00128       float square_distance_;
00129 
00130       ColorRGBA   selected_color, min_min_color, min_color, mid_color, max_color, max_max_color;  
00131 
00132       Representation* rep_;
00133       std::list<RegularData3D*> grid_list_;
00134       vector<Vector3> vertices_;
00135       MaterialSettings* material_settings_;
00136     };
00137 
00138   } // namespace VIEW
00139 } // namespace BALL
00140 
00141 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines