<commit_before>// IFC SDK : IFC2X3 C++ Early Classes  
// Copyright (C) 2009 CSTB
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full license is in Licence.txt file included with this 
// distribution or is available at :
//     http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
//
// This library 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 GNU
// Lesser General Public License for more details.



#include <ifc2x3/IfcPropertySingleValue.h>

#include <ifc2x3/CopyOp.h>
#include <ifc2x3/IfcSimpleProperty.h>
#include <ifc2x3/IfcUnit.h>
#include <ifc2x3/IfcValue.h>
#include <ifc2x3/Visitor.h>
#include <Step/BaseExpressDataSet.h>
#include <Step/BaseObject.h>
#include <Step/ClassType.h>
#include <Step/SPFFunctions.h>
#include <Step/String.h>


#include <stdlib.h>
#include <string>

#include "precompiled.h"

using namespace ifc2x3;

IfcPropertySingleValue::IfcPropertySingleValue(Step::Id id, Step::SPFData *args) : IfcSimpleProperty(id, args) {
    m_nominalValue = NULL;
    m_unit = NULL;
}

IfcPropertySingleValue::~IfcPropertySingleValue() {
}

bool IfcPropertySingleValue::acceptVisitor(Step::BaseVisitor *visitor) {
    return static_cast< Visitor * > (visitor)->visitIfcPropertySingleValue(this);
}

const std::string &IfcPropertySingleValue::type() const {
    return IfcPropertySingleValue::s_type.getName();
}

const Step::ClassType &IfcPropertySingleValue::getClassType() {
    return IfcPropertySingleValue::s_type;
}

const Step::ClassType &IfcPropertySingleValue::getType() const {
    return IfcPropertySingleValue::s_type;
}

bool IfcPropertySingleValue::isOfType(const Step::ClassType &t) const {
    return IfcPropertySingleValue::s_type == t ? true : IfcSimpleProperty::isOfType(t);
}

IfcValue *IfcPropertySingleValue::getNominalValue() {
    if (Step::BaseObject::inited()) {
        return m_nominalValue.get();
    }
    else {
        return NULL;
    }
}

const IfcValue *IfcPropertySingleValue::getNominalValue() const {
    IfcPropertySingleValue * deConstObject = const_cast< IfcPropertySingleValue * > (this);
    return deConstObject->getNominalValue();
}

void IfcPropertySingleValue::setNominalValue(const Step::RefPtr< IfcValue > &value) {
    m_nominalValue = value;
}

void IfcPropertySingleValue::unsetNominalValue() {
    m_nominalValue = Step::getUnset(getNominalValue());
}

bool IfcPropertySingleValue::testNominalValue() const {
    return !Step::isUnset(getNominalValue());
}

IfcUnit *IfcPropertySingleValue::getUnit() {
    if (Step::BaseObject::inited()) {
        return m_unit.get();
    }
    else {
        return NULL;
    }
}

const IfcUnit *IfcPropertySingleValue::getUnit() const {
    IfcPropertySingleValue * deConstObject = const_cast< IfcPropertySingleValue * > (this);
    return deConstObject->getUnit();
}

void IfcPropertySingleValue::setUnit(const Step::RefPtr< IfcUnit > &value) {
    m_unit = value;
}

void IfcPropertySingleValue::unsetUnit() {
    m_unit = Step::getUnset(getUnit());
}

bool IfcPropertySingleValue::testUnit() const {
    return !Step::isUnset(getUnit());
}

bool IfcPropertySingleValue::init() {
    bool status = IfcSimpleProperty::init();
    std::string arg;
    if (!status) {
        return false;
    }
    arg = m_args->getNext();
    if (arg == "$" || arg == "*") {
        m_nominalValue = NULL;
    }
    else {
        m_nominalValue = new IfcValue;
        if (arg[0] == '#') {
            m_nominalValue->set(m_expressDataSet->get((Step::Id)atol(arg.c_str() + 1)));
        }
        else if (arg[arg.length() - 1] == ')') {
            std::string type1;
            std::string::size_type i1;
            i1 = arg.find('(');
            if (i1 != std::string::npos) {
                type1 = arg.substr(0, i1);
                arg = arg.substr(i1 + 1, arg.length() - i1 - 2);
                if (type1 == "IFCVOLUMEMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcVolumeMeasure(tmp_attr1);
                }
                if (type1 == "IFCTIMEMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcTimeMeasure(tmp_attr1);
                }
                if (type1 == "IFCTHERMODYNAMICTEMPERATUREMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcThermodynamicTemperatureMeasure(tmp_attr1);
                }
                if (type1 == "IFCSOLIDANGLEMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcSolidAngleMeasure(tmp_attr1);
                }
                if (type1 == "IFCPOSITIVERATIOMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcPositiveRatioMeasure(tmp_attr1);
                }
                if (type1 == "IFCRATIOMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcRatioMeasure(tmp_attr1);
                }
                if (type1 == "IFCPOSITIVEPLANEANGLEMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcPositivePlaneAngleMeasure(tmp_attr1);
                }
                if (type1 == "IFCPLANEANGLEMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcPlaneAngleMeasure(tmp_attr1);
                }
                if (type1 == "IFCPARAMETERVALUE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcParameterValue(tmp_attr1);
                }
                if (type1 == "IFCNUMERICMEASURE") {
                    Step::Number tmp_attr1;
                    tmp_attr1 = Step::spfToInteger(arg);
                    m_nominalValue->setIfcNumericMeasure(tmp_attr1);
                }
                if (type1 == "IFCMASSMEASURE") {
                    Step::Real tmp_attr1;<commit_msg>Read IfcNumericMeasure as real type instead of integer...<commit_after>// IFC SDK : IFC2X3 C++ Early Classes  
// Copyright (C) 2009 CSTB
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full license is in Licence.txt file included with this 
// distribution or is available at :
//     http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
//
// This library 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 GNU
// Lesser General Public License for more details.



#include <ifc2x3/IfcPropertySingleValue.h>

#include <ifc2x3/CopyOp.h>
#include <ifc2x3/IfcSimpleProperty.h>
#include <ifc2x3/IfcUnit.h>
#include <ifc2x3/IfcValue.h>
#include <ifc2x3/Visitor.h>
#include <Step/BaseExpressDataSet.h>
#include <Step/BaseObject.h>
#include <Step/ClassType.h>
#include <Step/SPFFunctions.h>
#include <Step/String.h>


#include <stdlib.h>
#include <string>

#include "precompiled.h"

using namespace ifc2x3;

IfcPropertySingleValue::IfcPropertySingleValue(Step::Id id, Step::SPFData *args) : IfcSimpleProperty(id, args) {
    m_nominalValue = NULL;
    m_unit = NULL;
}

IfcPropertySingleValue::~IfcPropertySingleValue() {
}

bool IfcPropertySingleValue::acceptVisitor(Step::BaseVisitor *visitor) {
    return static_cast< Visitor * > (visitor)->visitIfcPropertySingleValue(this);
}

const std::string &IfcPropertySingleValue::type() const {
    return IfcPropertySingleValue::s_type.getName();
}

const Step::ClassType &IfcPropertySingleValue::getClassType() {
    return IfcPropertySingleValue::s_type;
}

const Step::ClassType &IfcPropertySingleValue::getType() const {
    return IfcPropertySingleValue::s_type;
}

bool IfcPropertySingleValue::isOfType(const Step::ClassType &t) const {
    return IfcPropertySingleValue::s_type == t ? true : IfcSimpleProperty::isOfType(t);
}

IfcValue *IfcPropertySingleValue::getNominalValue() {
    if (Step::BaseObject::inited()) {
        return m_nominalValue.get();
    }
    else {
        return NULL;
    }
}

const IfcValue *IfcPropertySingleValue::getNominalValue() const {
    IfcPropertySingleValue * deConstObject = const_cast< IfcPropertySingleValue * > (this);
    return deConstObject->getNominalValue();
}

void IfcPropertySingleValue::setNominalValue(const Step::RefPtr< IfcValue > &value) {
    m_nominalValue = value;
}

void IfcPropertySingleValue::unsetNominalValue() {
    m_nominalValue = Step::getUnset(getNominalValue());
}

bool IfcPropertySingleValue::testNominalValue() const {
    return !Step::isUnset(getNominalValue());
}

IfcUnit *IfcPropertySingleValue::getUnit() {
    if (Step::BaseObject::inited()) {
        return m_unit.get();
    }
    else {
        return NULL;
    }
}

const IfcUnit *IfcPropertySingleValue::getUnit() const {
    IfcPropertySingleValue * deConstObject = const_cast< IfcPropertySingleValue * > (this);
    return deConstObject->getUnit();
}

void IfcPropertySingleValue::setUnit(const Step::RefPtr< IfcUnit > &value) {
    m_unit = value;
}

void IfcPropertySingleValue::unsetUnit() {
    m_unit = Step::getUnset(getUnit());
}

bool IfcPropertySingleValue::testUnit() const {
    return !Step::isUnset(getUnit());
}

bool IfcPropertySingleValue::init() {
    bool status = IfcSimpleProperty::init();
    std::string arg;
    if (!status) {
        return false;
    }
    arg = m_args->getNext();
    if (arg == "$" || arg == "*") {
        m_nominalValue = NULL;
    }
    else {
        m_nominalValue = new IfcValue;
        if (arg[0] == '#') {
            m_nominalValue->set(m_expressDataSet->get((Step::Id)atol(arg.c_str() + 1)));
        }
        else if (arg[arg.length() - 1] == ')') {
            std::string type1;
            std::string::size_type i1;
            i1 = arg.find('(');
            if (i1 != std::string::npos) {
                type1 = arg.substr(0, i1);
                arg = arg.substr(i1 + 1, arg.length() - i1 - 2);
                if (type1 == "IFCVOLUMEMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcVolumeMeasure(tmp_attr1);
                }
                if (type1 == "IFCTIMEMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcTimeMeasure(tmp_attr1);
                }
                if (type1 == "IFCTHERMODYNAMICTEMPERATUREMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcThermodynamicTemperatureMeasure(tmp_attr1);
                }
                if (type1 == "IFCSOLIDANGLEMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcSolidAngleMeasure(tmp_attr1);
                }
                if (type1 == "IFCPOSITIVERATIOMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcPositiveRatioMeasure(tmp_attr1);
                }
                if (type1 == "IFCRATIOMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcRatioMeasure(tmp_attr1);
                }
                if (type1 == "IFCPOSITIVEPLANEANGLEMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcPositivePlaneAngleMeasure(tmp_attr1);
                }
                if (type1 == "IFCPLANEANGLEMEASURE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcPlaneAngleMeasure(tmp_attr1);
                }
                if (type1 == "IFCPARAMETERVALUE") {
                    Step::Real tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcParameterValue(tmp_attr1);
                }
                if (type1 == "IFCNUMERICMEASURE") {
                    Step::Number tmp_attr1;
                    tmp_attr1 = Step::spfToReal(arg);
                    m_nominalValue->setIfcNumericMeasure(tmp_attr1);
                }
                if (type1 == "IFCMASSMEASURE") {
                    Step::Real tmp_attr1;
{'fraction_non_alphanumeric': 0.1152955241724576, 'fraction_numerical': 0.011955465889561383, 'mean_word_length': 2.448595722751868, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6703800', 'n_tokens_mistral': 4291, 'n_tokens_neox': 4137, 'n_words': 784}