ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EditorObjStock.h
Go to the documentation of this file.
1 
7 // not so clear seems that Editor
8 // store static temporary values when drawing it, no used for this
9 // for moving the object also ? not used for this
10 
11 // in fact 2 different functions / roles, better to split
12 // declare types for helping to draw line and set move
13 // use global data, for kTranslate, kMove, GetSelect Support and Tendanc, Fibo...
14 
15 // seems better implemented as namespace
16 // http://stackoverflow.com/questions/5793334/c-static-vs-namespace-vs-singleton
17 // if never need to derive from it !
18 
19 // inline seems very important with namespace
20 // to avoid multiple definition
21 //http://stackoverflow.com/questions/7099947/namespace-either-undefined-or-redefined-why
22 
23 #ifndef _EDITOROBJSTOCK_H_
24 #define _EDITOROBJSTOCK_H_
25 
26 #include <iostream>
27 
28 //can use forwarded with c++11 enum
29 // could include directly here, import TypeLine (segment)
30 #include "TypeObjectLine.h"
31 
42 namespace EditorObjStock {
43 
44  // should be in unamed namespace ? works without
45  // strange error of compilation -fPIC missing to create the library ??
46  // namespace {
49 
50  //boolean for Anchor, anchor selected by GUIMAinFrame, good use of static
51  extern bool kAnchor;
52  extern bool kTranslate;
53  extern bool kRotate;
54  //} // anonymous
55 
56  // cannot be static and const, no object, used ??
57  inline TypeLine GetMode () { return fEditorModeObjStock;}
58  void SetMode ( std::string mode );
59 
60  inline bool GetAnchor () { return kAnchor;}
61  inline void SetAnchor ( bool kbool ) { kbool ? (kAnchor=true) : (kAnchor=false);}
62 
63  inline bool GetTranslate() { return kTranslate; }
64  inline bool GetRotate () { return kRotate; }
65 
66  // switch on/off ( when key is pressed ), assert maximum one is on
67  inline void SetTranslate() { kTranslate ? (kTranslate=false) : (kTranslate=true);
68  kRotate = false;}
69  inline void SetRotate() { kRotate ? ( kRotate=false) : (kRotate=true);
70  kTranslate = false;}
71 }
72 
73 #endif // _EDITOROBJSTOCK_H_
TypeLine GetMode()
void SetAnchor(bool kbool)
TypeLine fEditorModeObjStock
defined in TypeObjectLine segment, half-segment.
void SetMode(std::string mode)
TypeLine
c++ 11 style, used by both EditorObjectStock and ObjectLine cannot make dictionary with enum class ! ...