示例#1
0
/**
 * @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;
}
示例#2
0
/**
 * @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;
}
示例#3
0
	/**
	 * @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;
	}
示例#4
0
/**
 * @return The linear precision for this document.
 * This is determined by the variable "$LUPREC".
 */
int RS_Graphic::getAnglePrecision() {
    return getVariableInt("$AUPREC", 4);
}
示例#5
0
/**
 * @return The linear precision for this document.
 * This is determined by the variable "$LUPREC".
 */
int RS_Graphic::getLinearPrecision() {
    return getVariableInt("$LUPREC", 4);
}
示例#6
0
/**
 * Gets the unit of this graphic
 */
RS2::Unit RS_Graphic::getUnit() {
    return (RS2::Unit)getVariableInt("$INSUNITS", 0);
    //return unit;
}
示例#7
0
/**
 * @return true if the isometric grid is switched on (visible).
 */
bool RS_Graphic::isIsometricGrid() {
    //$ISOMETRICGRID == $SNAPSTYLE
        int on = getVariableInt("$SNAPSTYLE", 0);
        return on!=0;
}
示例#8
0
/**
 * @return true if the grid is switched on (visible).
 */
bool RS_Graphic::isGridOn() {
        int on = getVariableInt("$GRIDMODE", 1);
        return on!=0;
}