mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
82 lines
3.6 KiB
C++
82 lines
3.6 KiB
C++
/********************************************************************************
|
|
* *
|
|
* This file is part of IfcOpenShell. *
|
|
* *
|
|
* IfcOpenShell is free software: you can redistribute it and/or modify *
|
|
* it under the terms of the Lesser GNU General Public License as published by *
|
|
* the Free Software Foundation, either version 3.0 of the License, or *
|
|
* (at your option) any later version. *
|
|
* *
|
|
* IfcOpenShell is distributed in the hope that it will be useful, *
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
* Lesser GNU General Public License for more details. *
|
|
* *
|
|
* You should have received a copy of the Lesser GNU General Public License *
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
* *
|
|
********************************************************************************/
|
|
|
|
#ifndef IFCLATEBOUNDENTITY_H
|
|
#define IFCLATEBOUNDENTITY_H
|
|
|
|
#include <string>
|
|
|
|
#include "../ifcparse/IfcUtil.h"
|
|
#include "../ifcparse/IfcWrite.h"
|
|
#include "../ifcparse/IfcWritableEntity.h"
|
|
|
|
namespace IfcParse {
|
|
|
|
// TODO: Somehow these methods should become part of IfcBaseEntity directly so
|
|
// that in the IfcFile class the distinction what entity type to be created is
|
|
// no longer necessary and weird diagonal casts when creating geometry from
|
|
// IfcLateBoundEntities are eliminated.
|
|
class IfcLateBoundEntity : public IfcUtil::IfcBaseEntity {
|
|
private:
|
|
IfcSchema::Type::Enum _type;
|
|
IfcWrite::IfcWritableEntity* writable_entity();
|
|
void invalid_argument(unsigned int i, const std::string& t);
|
|
public:
|
|
IfcLateBoundEntity(const std::string& s);
|
|
IfcLateBoundEntity(IfcAbstractEntity* e);
|
|
|
|
bool is(IfcSchema::Type::Enum v) const;
|
|
IfcSchema::Type::Enum type() const;
|
|
bool is_a(const std::string& s) const;
|
|
std::string is_a() const;
|
|
|
|
unsigned int id() const;
|
|
unsigned int getArgumentCount() const;
|
|
IfcUtil::ArgumentType getArgumentType(unsigned int i) const;
|
|
IfcSchema::Type::Enum getArgumentEntity(unsigned int i) const;
|
|
Argument* getArgument(unsigned int i) const;
|
|
const char* getArgumentName(unsigned int i) const;
|
|
unsigned getArgumentIndex(const std::string& a) const;
|
|
bool getArgumentOptionality(unsigned int i) const;
|
|
|
|
IfcEntityList::ptr get_inverse(const std::string& a);
|
|
|
|
void setArgument(unsigned int i);
|
|
void setArgument(unsigned int i, int v);
|
|
void setArgument(unsigned int i, bool v);
|
|
void setArgument(unsigned int i, double v);
|
|
void setArgument(unsigned int i, const std::string& v);
|
|
void setArgument(unsigned int i, const std::vector<int>& v);
|
|
void setArgument(unsigned int i, const std::vector<double>& v);
|
|
void setArgument(unsigned int i, const std::vector<std::string>& v);
|
|
void setArgument(unsigned int i, IfcLateBoundEntity* v);
|
|
void setArgument(unsigned int i, IfcEntityList::ptr v);
|
|
|
|
std::string toString();
|
|
|
|
// TODO: Write as SWIG extension methods?
|
|
std::pair<IfcUtil::ArgumentType,Argument*> get_argument(unsigned i);
|
|
std::pair<IfcUtil::ArgumentType,Argument*> get_argument(const std::string& a);
|
|
|
|
bool is_valid();
|
|
};
|
|
|
|
}
|
|
|
|
#endif |