New files, editor for QuadSet gluing together translation and palette sub-editors.
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 16 Nov 2006 20:34:20 +0000 (20:34 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 16 Nov 2006 20:34:20 +0000 (20:34 +0000)
EVE/Reve/QuadSetEditor.cxx [new file with mode: 0644]
EVE/Reve/QuadSetEditor.h [new file with mode: 0644]

diff --git a/EVE/Reve/QuadSetEditor.cxx b/EVE/Reve/QuadSetEditor.cxx
new file mode 100644 (file)
index 0000000..78a6110
--- /dev/null
@@ -0,0 +1,81 @@
+// $Header$
+
+#include "QuadSetEditor.h"
+#include <Reve/QuadSet.h>
+
+#include <Reve/RGValuators.h>
+#include <Reve/ZTransEditor.h>
+#include <Reve/RGBAPaletteEditor.h>
+
+#include <TVirtualPad.h>
+#include <TColor.h>
+
+#include <TGLabel.h>
+#include <TGButton.h>
+#include <TGNumberEntry.h>
+#include <TGColorSelect.h>
+#include <TGDoubleSlider.h>
+
+using namespace Reve;
+
+//______________________________________________________________________
+// QuadSetEditor
+//
+
+ClassImp(QuadSetEditor)
+
+QuadSetEditor::QuadSetEditor(const TGWindow *p, Int_t width, Int_t height,
+                            UInt_t options, Pixel_t back) :
+  TGedFrame(p, width, height, options | kVerticalFrame, back),
+  fM(0),
+  fHMTrans   (0),
+  fPalette   (0)
+  // Initialize widget pointers to 0
+{
+  MakeTitle("Transformation matrix");
+
+  fHMTrans = new ZTransSubEditor(this);
+  fHMTrans->Connect("UseTrans()",     "Reve::QuadSetEditor", this, "Update()");
+  fHMTrans->Connect("TransChanged()", "Reve::QuadSetEditor", this, "Update()");
+  AddFrame(fHMTrans, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 0, 0));
+
+  MakeTitle("Palette controls");
+
+  fPalette = new RGBAPaletteSubEditor(this);
+  fPalette->Connect("Changed", "Reve::QuadSetEditor", this, "Update()");
+  AddFrame(fPalette, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 0, 0));
+
+  MakeTitle("QuadSet");
+
+  // Create widgets
+  // fXYZZ = new TGSomeWidget(this, ...);
+  // AddFrame(fXYZZ, new TGLayoutHints(...));
+  // fXYZZ->Connect("SignalName()", "Reve::QuadSetEditor", this, "DoXYZZ()");
+}
+
+QuadSetEditor::~QuadSetEditor()
+{}
+
+/**************************************************************************/
+
+void QuadSetEditor::SetModel(TObject* obj)
+{
+  fM = dynamic_cast<QuadSet*>(obj);
+
+  fHMTrans->SetDataFromTrans(&fM->fHMTrans);
+
+  fPalette->SetModel(fM->fPalette);
+
+  // Set values of widgets
+  // fXYZZ->SetValue(fM->GetXYZZ());
+}
+
+/**************************************************************************/
+
+// Implements callback/slot methods
+
+// void QuadSetEditor::DoXYZZ()
+// {
+//   fM->SetXYZZ(fXYZZ->GetValue());
+//   Update();
+// }
diff --git a/EVE/Reve/QuadSetEditor.h b/EVE/Reve/QuadSetEditor.h
new file mode 100644 (file)
index 0000000..9a6ed46
--- /dev/null
@@ -0,0 +1,54 @@
+// $Header$
+
+#ifndef REVE_QuadSetEditor_H
+#define REVE_QuadSetEditor_H
+
+#include <TGedFrame.h>
+
+class TGCheckButton;
+class TGNumberEntry;
+class TGColorSelect;
+
+namespace Reve {
+
+class QuadSet;
+
+class RGValuator;
+class RGDoubleValuator;
+class ZTransSubEditor;
+
+// It would be better to have button to change model to the palette
+// object itself.
+class RGBAPaletteSubEditor;
+
+class QuadSetEditor : public TGedFrame
+{
+private:
+  QuadSetEditor(const QuadSetEditor&);            // Not implemented
+  QuadSetEditor& operator=(const QuadSetEditor&); // Not implemented
+
+protected:
+  QuadSet* fM; // fModel dynamic-casted to QuadSetEditor
+
+  ZTransSubEditor* fHMTrans;
+
+  RGBAPaletteSubEditor* fPalette;
+
+  // Declare widgets
+  // TGSomeWidget*   fXYZZ;
+
+public:
+  QuadSetEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
+  virtual ~QuadSetEditor();
+
+  virtual void SetModel(TObject* obj);
+
+  // Declare callback/slot methods
+  // void DoXYZZ();
+
+  ClassDef(QuadSetEditor, 1); // Editor for QuadSet
+}; // endclass QuadSetEditor
+
+}
+
+#endif