/** * @return The linear format type for this document. * This is determined by the variable "$LUNITS". */ RS2::LinearFormat RS_Graphic::getLinearFormat() { int lunits = getVariableInt("$LUNITS", 2); switch (lunits) { default: case 2: return RS2::Decimal; break; case 1: return RS2::Scientific; break; case 3: return RS2::Engineering; break; case 4: return RS2::Architectural; break; case 5: return RS2::Fractional; break; } return RS2::Decimal; }
/** * @return The angle format type for this document. * This is determined by the variable "$AUNITS". */ RS2::AngleFormat RS_Graphic::getAngleFormat() { int aunits = getVariableInt("$AUNITS", 0); switch (aunits) { default: case 0: return RS2::DegreesDecimal; break; case 1: return RS2::DegreesMinutesSeconds; break; case 2: return RS2::Gradians; break; case 3: return RS2::Radians; break; case 4: return RS2::Surveyors; break; } return RS2::DegreesDecimal; }
/** * @brief Loads a variable into memory. * * Checks to see if this variable is loaded, and if not, checks that it exists in the file * Use this method when the variable to load is of type int * * @param variable * @return status of the operation */ long Model::loadVariableInt(const std::string& variable) { //first, check to determine whether variable is already loaded if (variableDataInt.find(variable) != variableDataInt.end()) return true; //first check if the variable exists in the file!! if (!this->doesVariableExist(variable)) { return FileReader::VARIABLE_DOES_NOT_EXIST; } std::vector<int> * data = getVariableInt(variable); long id = getVariableID(variable); if (data->size() > 0) { variableDataInt[variable] = data; variableDataIntByID[id] = data; } //else return false; return FileReader::OK; }
/** * @return The linear precision for this document. * This is determined by the variable "$LUPREC". */ int RS_Graphic::getAnglePrecision() { return getVariableInt("$AUPREC", 4); }
/** * @return The linear precision for this document. * This is determined by the variable "$LUPREC". */ int RS_Graphic::getLinearPrecision() { return getVariableInt("$LUPREC", 4); }
/** * Gets the unit of this graphic */ RS2::Unit RS_Graphic::getUnit() { return (RS2::Unit)getVariableInt("$INSUNITS", 0); //return unit; }
/** * @return true if the isometric grid is switched on (visible). */ bool RS_Graphic::isIsometricGrid() { //$ISOMETRICGRID == $SNAPSTYLE int on = getVariableInt("$SNAPSTYLE", 0); return on!=0; }
/** * @return true if the grid is switched on (visible). */ bool RS_Graphic::isGridOn() { int on = getVariableInt("$GRIDMODE", 1); return on!=0; }