//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RimCellRangeFilterCollection::updateIconState()
{
    bool activeIcon = true;

    RimViewController* viewController = baseView()->viewController();
    if (viewController && ( viewController->isRangeFiltersControlled() 
                         || viewController->isVisibleCellsOveridden()) )
    {
        activeIcon = false;
    }

    if (!isActive)
    {
        activeIcon = false;
    }

    updateUiIconFromState(activeIcon);

    for (size_t i = 0; i < rangeFilters.size(); i++)
    {
        RimCellRangeFilter* rangeFilter = rangeFilters[i];
        rangeFilter->updateActiveState();
        rangeFilter->updateIconState();
    }
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
RigFemPartCollection* RimCellRangeFilterCollection::femPartColl() const
{
    RimGeoMechView* geoView = dynamic_cast<RimGeoMechView*>(baseView());
    if (geoView &&
        geoView->geoMechCase() &&
        geoView->geoMechCase()->geoMechData() )
    {
        return geoView->geoMechCase()->geoMechData()->femParts();
    }

    return NULL;
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RimCellRangeFilterCollection::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName)
{
    PdmObject::defineUiTreeOrdering(uiTreeOrdering, uiConfigName);

    RimViewController* viewController = baseView()->viewController();
    if (viewController && viewController->isRangeFiltersControlled())
    {
        isActive.uiCapability()->setUiReadOnly(true);
    }
    else
    {
        isActive.uiCapability()->setUiReadOnly(false);
    }

    updateIconState();
}
Пример #4
0
//----------------------------------------------------------------------------
// TODO: add in enhancement data here
void NounShip::updateCharacter()
{
	PROFILE_FUNCTION();

	float m = mass();
	m *=  calculateModifier( MT_MASS );
	if ( m < 1.0f )
		m = 1.0f;

	m_Sensor = baseSensor();
	m_View = baseView();
	m_MaxDamage = baseDamage();
	m_MaxEnergy = baseEnergy();
	m_MaxVelocity = baseVelocity();
	m_MaxCargo = baseCargo();
	m_MaxThrust = baseThrust();

	for(int i=0;i<m_Gadgets.size();i++)
	{
		NounGadget * pGadget = m_Gadgets[i];

		m				+= pGadget->addMass();
		m_Sensor		+= pGadget->addSensor();
		m_MaxVelocity	+= pGadget->addMaxVelocity() * velocityModifier();
		m_MaxDamage		+= pGadget->addMaxDamage();
		m_MaxEnergy		+= pGadget->addMaxEnergy();
		m_MaxCargo		+= pGadget->addCargo();
		m_MaxThrust		+= pGadget->addThrust();
	}

	//calculate the acceleration by taking the thrust and dividing by the mass of the ship
	m_MaxAcceleration = m_MaxThrust / m;
	
	//calculate the turn rate (yaw) by taking the baseYaw(), dividing by the mass of the ship and adding a fraction of m_MaxAcceleration
	m_MaxYaw = (baseYaw() / m) + (m_MaxAcceleration / 10);

	//apply enhancements to ships, including gadget effects
	m_MaxVelocity *=  calculateModifier( MT_DRIVE_VELOCITY );
	m_MaxThrust	*= calculateModifier( MT_DRIVE_THRUST );
	m_MaxYaw *= calculateModifier( MT_TURNRATE );
	m_MaxEnergy *= calculateModifier( MT_SHIPENERGY );
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
RimEclipseView* RimCellRangeFilterCollection::eclipseView() const
{
    return dynamic_cast<RimEclipseView*>(baseView());
}