00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_VIEW_DIALOGS_MODIFYSURFACEDIALOG_H
00008 #define BALL_VIEW_DIALOGS_MODIFYSURFACEDIALOG_H
00009
00010 #ifndef BALL_COMMON_GLOBAL_H
00011 # include <BALL/COMMON/global.h>
00012 #endif
00013
00014 #ifdef BALL_COMPILER_MSVC
00015 # include <BALL/VIEW/UIC/ui_modifyRepresentationDialog.h>
00016 #else
00017 # include <BALL/VIEW/UIC/modifyRepresentationDialogData.h>
00018 #endif
00019
00020
00021 #ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
00022 # include <BALL/VIEW/DATATYPE/colorRGBA.h>
00023 #endif
00024
00025 #ifndef BALL_VIEW_PRIMITIVES_MESH_H
00026 # include <BALL/VIEW/PRIMITIVES/mesh.h>
00027 #endif
00028
00029 #ifndef BALL_VIEW_KERNEL_REPRESENTATION_H
00030 # include <BALL/VIEW/KERNEL/representation.h>
00031 #endif
00032
00033 #ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
00034 # include <BALL/VIEW/KERNEL/modularWidget.h>
00035 #endif
00036
00037 #ifndef BALL_DATATYPE_REGULARDATA3D
00038 # include <BALL/DATATYPE/regularData3D.h>
00039 #endif
00040
00041 #ifndef BALL_DATATYPE_HASHGRID_H
00042 # include <BALL/DATATYPE/hashGrid.h>
00043 #endif
00044
00045 #ifndef BALL_VIEW_DIALOG_MATERIALSETTINGS_H
00046 # include <BALL/VIEW/DIALOGS/materialSettings.h>
00047 #endif
00048
00049
00050 namespace BALL
00051 {
00052 namespace VIEW
00053 {
00059 class BALL_VIEW_EXPORT ModifyRepresentationDialog
00060 : public QDialog,
00061 public Ui_ModifyRepresentationDialogData,
00062 public ModularWidget
00063 {
00064 Q_OBJECT
00065
00066 public:
00067
00068 BALL_EMBEDDABLE(ModifyRepresentationDialog, ModularWidget)
00069
00070
00071 ModifyRepresentationDialog(QWidget* parent = 0, const char* name = "ModifyRepresentationDialog",
00072 bool modal = FALSE, Qt::WFlags fl = 0);
00073
00075 ~ModifyRepresentationDialog();
00076
00078 virtual void onNotify(Message *message);
00079
00081 void setRepresentation(Representation* rep);
00082
00084 void setGrid(RegularData3D* grid);
00085
00087 void setMinValue(float value);
00088
00090 void setMaxValue(float value);
00091
00093 void setMidValue(float value);
00094
00096 void setSplitRadius(float distance);
00097
00099 void setMode(Position pos);
00100
00101 public slots:
00102
00103 void applyPressed();
00104 void cancelPressed();
00105 void maxPressed();
00106 void midPressed();
00107 void minPressed();
00108 void minMinPressed();
00109 void maxMaxPressed();
00110 void tabChanged();
00111 void autoScale();
00112 void choosePressed();
00113 void gridSelected();
00114 void show();
00115 void applySplit();
00116
00117 protected slots:
00118
00119 void gridTransparencyChanged();
00120 void customColorTransparencyChanged();
00121 void changeDrawingModeTransparencyChanged();
00122 void splitMethodChanged();
00123 void normalizationChanged();
00124
00125 protected:
00126
00127 ModifyRepresentationDialog(const ModifyRepresentationDialog& dialog);
00128
00129 typedef HashGrid3<const Atom*> AtomGrid;
00130 typedef HashGridBox3<const Atom*> AtomBox;
00131 void colorByCustomColor_();
00132 bool colorByGrid_();
00133 bool insertGrid_(RegularData3D& grid, const String& name);
00134 void removeGrid_(RegularData3D& grid);
00135 void setColor_(ColorRGBA& color, const QLabel* label, const QSpinBox* box);
00136 void getColor_(const ColorRGBA& color, QLabel* label, QSpinBox* box);
00137 void invalidateGrid_();
00138 void invalidateMesh_();
00139 void changeDrawingMode_();
00140 void checkApplyButton_();
00141
00142 void calculateIncludedVertices_(vector<bool>& include_vertex, const Mesh& org_mesh, HashSet<const Composite*>& roots);
00143 inline bool checkInclude_(const AtomGrid& atom_grid, const Vector3& point) const;
00144
00145 RegularData3D* grid_;
00146 float min_value_;
00147 float mid_value_;
00148 float max_value_;
00149 float square_distance_;
00150
00151 ColorRGBA selected_color, min_min_color, min_color, mid_color, max_color, max_max_color;
00152
00153 Representation* rep_;
00154 List<RegularData3D*> grid_list_;
00155 vector<Vector3> vertices_;
00156 MaterialSettings* material_settings_;
00157 };
00158
00159 }
00160 }
00161
00162 #endif