Esempio n. 1
0
	void configure() {
		Shape::configure();

		m_dpdu = m_objectToWorld(Vector(2, 0, 0));
		m_dpdv = m_objectToWorld(Vector(0, 2, 0));
		Normal normal = normalize(m_objectToWorld(Normal(0, 0, 1)));
		m_frame = Frame(normalize(m_dpdu), normalize(m_dpdv), normal);

		m_invSurfaceArea = 1.0f / getSurfaceArea();
		if (std::abs(dot(normalize(m_dpdu), normalize(m_dpdv))) > Epsilon)
			Log(EError, "Error: 'toWorld' transformation contains shear!");
	}
  bool InternalMassDefinition_Impl::setDesignLevelCalculationMethod(const std::string& method,
                                                                    double floorArea,
                                                                    double numPeople)
  {
    std::string wmethod(method);
    boost::to_lower(wmethod);

    if (wmethod == "surfacearea") {
      return setSurfaceArea(getSurfaceArea(floorArea,numPeople));
    }
    else if (wmethod == "surfacearea/area") {
      return setSurfaceAreaperSpaceFloorArea(getSurfaceAreaPerFloorArea(floorArea,numPeople));
    }
    else if (wmethod == "surfacearea/person") {
      return setSurfaceAreaperPerson(getSurfaceAreaPerPerson(floorArea,numPeople));
    }

    return false;
  }