MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lgrAnnotationFactory.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2025 MAK Technologies, Inc
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef lgrAnnotationFactory_H_
11 #define lgrAnnotationFactory_H_
12 
13 #include <lgrAnnotations/lgrAnn.h>
14 
15 #include <list>
16 #include <map>
17 #include <QString>
18 #include <QStringList>
19 #include <vlutil/vlString.h>
20 
21 class QPainter;
22 class QWidget;
23 class DtEnvObject;
24 
25 namespace MAKLogger
26 {
27  class DtLgrAnnotation;
28  class DtLgrAnnotationManager;
29  class DtLgrAnnotationSliderBar;
30  class DtLgrGuiModel;
31  class DtSliderBar;
32  class DtTimeComponent;
33 
37  {
38  public:
39 
42  typedef DtLgrAnnotation* (*AnnotationCreator)(QWidget*,DtLgrGuiModel*);
43 
45  typedef void (*AnnotationModifier)(QWidget*,DtLgrAnnotation*,DtLgrGuiModel*);
46 
49  typedef DtLgrAnnotation* (*AnnotationLoader)(const DtEnvObject* object);
50 
52  typedef DtLgrAnnotationSliderBar* (*AnnotationBarCreator)(DtLgrAnnotation* annotation);
53 
55  typedef DtLgrAnnotation* (*AnnotationConvertor)(const DtLgrAnnotation* annotation);
56 
58 
59  DtLgrAnnotationDefinition(QString guiTypeName,
60  QString accelerator,QString icon,DtString type,
61  AnnotationCreator creator, AnnotationModifier modifier,
62  AnnotationLoader loader,AnnotationBarCreator barCreator);
63 
66 
70 
73  QString myGuiTypeName;
74 
77 
79  QString myGuiIcon;
80 
82  DtString myType;
83 
85  AnnotationCreator myCreator;
86 
88  AnnotationModifier myModifier;
89 
91  AnnotationLoader myLoader;
92 
94  AnnotationBarCreator myBarCreator;
95  };
96 
97  typedef std::map<DtString,DtLgrAnnotationDefinition> DtAnnotationTypeMap;
98 
102  {
103  private:
112 
113  public:
114 
116  static const DtAnnotationTypeMap& annotationTypesMap();
117 
119  static const QStringList& annotationTypeNames();
120 
122  static DtLgrAnnotation* createAnnotation(const DtString& type,
123  QWidget* parent,DtLgrGuiModel* model);
124 
126  static void editAnnotation(QWidget* parent,DtLgrAnnotation*,
127  DtLgrGuiModel* model);
128 
132  static DtLgrAnnotation* convertAnnotation( const DtString& type,
133  const DtLgrAnnotation* source);
134 
137  static DtLgrAnnotation* loadAnnotation(const DtEnvObject* object);
138 
140  static DtLgrAnnotationSliderBar* createSliderBar(DtLgrAnnotation*);
141 
143  static bool isAnnotationType(const DtString& type);
144 
147  static void registerAnnotationType(const DtLgrAnnotationDefinition&
148  typeDefinition);
149 
150  static void registerAnnotationConversion(const DtString& destinationType,
151  const DtString& sourceType,DtLgrAnnotationDefinition::AnnotationConvertor function);
152 
154  static const std::list<DtString>& availableConversions(const DtString& sourceType);
155 
156  protected:
157 
161  static DtLgrAnnotationDefinition& getKnownDefinition(const DtString& type);
162 
163  static DtString conversionKey(const DtString& destType,
164  const DtString& srcType);
165 
167  static std::list<DtString> theAnnotationTypeList;
168  static QStringList theAnnotationTypeNames;
169 
172 
173  typedef std::map<DtString,DtLgrAnnotationDefinition::AnnotationConvertor> ConvertorMap;
174  typedef std::map<DtString, std::list<DtString> > ConversionListMap;
175 
179  };
180 }
181 
182 #endif
AnnotationLoader myLoader
The loader function for the type.
Definition: lgrAnnotationFactory.h:91
static QStringList theAnnotationTypeNames
Definition: lgrAnnotationFactory.h:168
Annotation factory responsible for holding functions with display an annotation creation dialog and r...
Definition: lgrAnnotationFactory.h:101
std::map< DtString, std::list< DtString > > ConversionListMap
Definition: lgrAnnotationFactory.h:174
std::map< DtString, DtLgrAnnotationDefinition::AnnotationConvertor > ConvertorMap
Definition: lgrAnnotationFactory.h:173
Defines INPORT/EXPORT macros for lgrGui library.
QString myGuiAccelerator
The accelerator which will bring up the creation dialog.
Definition: lgrAnnotationFactory.h:76
QString myGuiIcon
The string which indicates the name of the icon to use.
Definition: lgrAnnotationFactory.h:79
DtLgrAnnotation *(* AnnotationConvertor)(const DtLgrAnnotation *annotation)
Convert an annotation.
Definition: lgrAnnotationFactory.h:55
The logger GUI&#39;s model.
Definition: lgrGuiModel.h:56
AnnotationModifier myModifier
The create modifier for the type.
Definition: lgrAnnotationFactory.h:88
Annotation slider bar class.
Definition: lgrAnnotationSliderBar.h:25
AnnotationCreator myCreator
The create function for the type.
Definition: lgrAnnotationFactory.h:85
QString myGuiTypeName
The type name to be used in the GUI.
Definition: lgrAnnotationFactory.h:73
Base annotation class defines interface for all annotations.
Definition: lgrAnnotation.h:26
static DtAnnotationTypeMap theAnnotationTypes
The list of annotation types.
Definition: lgrAnnotationFactory.h:171
DtString myType
The unique string identifier for the type.
Definition: lgrAnnotationFactory.h:82
static std::list< DtString > theAnnotationTypeList
The list of type strings.
Definition: lgrAnnotationFactory.h:167
AnnotationBarCreator myBarCreator
The drawing function for the type.
Definition: lgrAnnotationFactory.h:94
static ConvertorMap theConvertorMap
A map of conversion functions.
Definition: lgrAnnotationFactory.h:177
static ConversionListMap theConversionListMap
Definition: lgrAnnotationFactory.h:178
An Annotation definition allows annotation types to be defined which is necessary for generic instant...
Definition: lgrAnnotationFactory.h:36
std::map< DtString, DtLgrAnnotationDefinition > DtAnnotationTypeMap
Definition: lgrAnnotationFactory.h:97
#define DT_DLL_LGRANN
Definition: lgrAnn.h:19

Document ID: Generated on Thu Dec 18 15:35:09 EST 2025 from SVN revision 282494
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)