Geophysical Inversion and Modelling Library v1.5.4
Loading...
Searching...
No Matches
baseentity.h
1/******************************************************************************
2 * Copyright (C) 2005-2024 by the GIMLi development team *
3 * Carsten Rücker carsten@resistivity.net *
4 * *
5 * Licensed under the Apache License, Version 2.0 (the "License"); *
6 * you may not use this file except in compliance with the License. *
7 * You may obtain a copy of the License at *
8 * *
9 * http://www.apache.org/licenses/LICENSE-2.0 *
10 * *
11 * Unless required by applicable law or agreed to in writing, software *
12 * distributed under the License is distributed on an "AS IS" BASIS, *
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
14 * See the License for the specific language governing permissions and *
15 * limitations under the License. *
16 * *
17 ******************************************************************************/
18
19#ifndef _GIMLI_BASEENTITY__H
20#define _GIMLI_BASEENTITY__H
21
22#include "gimli.h"
23
24namespace GIMLI{
25
27
30class DLLEXPORT BaseEntity{
31 public:
32 BaseEntity()
33 : id_(-1), valid_(false), marker_(0) { }
34
35 BaseEntity(const BaseEntity & ent)
36 : id_(ent.id()), valid_(ent.valid()), marker_(ent.marker()){
37 }
38
39 BaseEntity & operator = (const BaseEntity & ent){
40 if (this != &ent){
41 id_ = ent.id();
42 valid_ = ent.valid();
43 marker_ = ent.marker();
44 } return * this;
45 }
46
47 virtual ~BaseEntity(){}
48
50 inline virtual uint rtti() const { return MESH_BASEENTITY_RTTI; }
51
53 inline virtual bool valid() const { return valid_; }
54
56 inline virtual void setValid(bool valid) { valid_ = valid ; }
57
59 inline int id() const { return id_; }
60
62 inline void setId(int id) { id_ = id ; }
63
64 inline void setMarker(int marker) { marker_ = marker; }
65
66 inline int marker() const { return marker_; }
67
70 inline void setTagged(bool tagged){ tagged_ = tagged; }
71
73 inline void untag() { setTagged(false); }
74
76 inline void tag() { setTagged(true); }
77
79 inline bool tagged() const { return tagged_; }
80
81protected:
82 int id_;
83
84 bool valid_;
85
86 int marker_;
87
88 bool tagged_;
89
90}; // class BaseEntity;
91
92} // namespace GIMLI{
93
94
95#endif // _GIMLI_BASEENTITY__H
virtual uint rtti() const
Definition baseentity.h:50
virtual void setValid(bool valid)
Definition baseentity.h:56
virtual bool valid() const
Definition baseentity.h:53
void setTagged(bool tagged)
Definition baseentity.h:70
void untag()
Definition baseentity.h:73
int id() const
Definition baseentity.h:59
bool tagged() const
Definition baseentity.h:79
void tag()
Definition baseentity.h:76
void setId(int id)
Definition baseentity.h:62
GIMLi main namespace for the Geophyiscal Inversion and Modelling Library.
Definition baseentity.h:24