本文整理汇总了C++中GetProperties函数的典型用法代码示例。如果您正苦于以下问题:C++ GetProperties函数的具体用法?C++ GetProperties怎么用?C++ GetProperties使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetProperties函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetProperties
// --------------------------------------------------------------
void CairoFont::SelectFont( cairo_t * cr ) const
{
cairo_font_slant_t slant = GetProperties() & VGFont::kFontItalic ? CAIRO_FONT_SLANT_ITALIC : CAIRO_FONT_SLANT_NORMAL;
cairo_font_weight_t weight = GetProperties() & VGFont::kFontBold ? CAIRO_FONT_WEIGHT_BOLD : CAIRO_FONT_WEIGHT_NORMAL;
cairo_select_font_face (cr, GetName(), slant, weight);
cairo_set_font_size (cr, GetSize());
}
示例2: GetProperties
double& PointLoad2DCondition::CalculateIntegrationWeight(double& rIntegrationWeight)
{
if( GetProperties()[THICKNESS] > 0 )
rIntegrationWeight *= GetProperties()[THICKNESS];
return rIntegrationWeight;
}
示例3: new
bool cSoundStream::CreateRenderingProperties()
{
if(GetProperties())
return true;
vSoundStreamProperties *tmp = new (std::nothrow) vSoundStreamProperties;
__super::m_RenderingProperties = tmp;
return GetProperties() != NULL;
};
示例4: new
bool cSprite3D::CreateRenderingProperties()
{
if(GetProperties())
return true;
vSprite3DProperties *tmp = new (std::nothrow) vSprite3DProperties;
__super::m_RenderingProperties = tmp;
return GetProperties() != NULL;
}
示例5: GetProperties
void LineLoadAxisym2DCondition::CalculateAndAddRHS(LocalSystemComponents& rLocalSystem, GeneralVariables& rVariables, Vector& rVolumeForce, double& rIntegrationWeight)
{
double IntegrationWeight = rIntegrationWeight * 2.0 * 3.141592654 * rVariables.CurrentRadius;
if( GetProperties()[THICKNESS] > 0 )
IntegrationWeight /= GetProperties()[THICKNESS];
//contribution to external forces
ForceLoadCondition::CalculateAndAddRHS( rLocalSystem, rVariables, rVolumeForce, IntegrationWeight );
//KRATOS_WATCH( rRightHandSideVector )
}
示例6: GetProperties
double& CamClayKinematicHardeningLaw::CalculateHardening(double &rHardening, const double &rAlpha, const double rTemperature)
{
double FirstPreconsolidationPressure = GetProperties()[PRE_CONSOLIDATION_STRESS];
double SwellingSlope = GetProperties()[SWELLING_SLOPE];
double OtherSlope = GetProperties()[NORMAL_COMPRESSION_SLOPE];
rHardening = -FirstPreconsolidationPressure*(std::exp (-rAlpha/(OtherSlope-SwellingSlope)) ) ;
return rHardening;
}
示例7: GetGeometry
//************************************************************************************
//************************************************************************************
void ThermalFace2D::CalculateAll(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, ProcessInfo& rCurrentProcessInfo, bool CalculateStiffnessMatrixFlag, bool CalculateResidualVectorFlag)
{
KRATOS_TRY
unsigned int number_of_nodes = GetGeometry().size();
//resizing as needed the LHS
unsigned int MatSize=number_of_nodes;
ConvectionDiffusionSettings::Pointer my_settings = rCurrentProcessInfo.GetValue(CONVECTION_DIFFUSION_SETTINGS);
const Variable<double>& rUnknownVar = my_settings->GetUnknownVariable();
const Variable<double>& rSurfaceSourceVar = my_settings->GetSurfaceSourceVariable();
//calculate lenght
double x21 = GetGeometry()[1].X() - GetGeometry()[0].X();
double y21 = GetGeometry()[1].Y() - GetGeometry()[0].Y();
double lenght = x21*x21 + y21*y21;
lenght = sqrt(lenght);
const Properties& ConstProp = GetProperties();
const double& ambient_temperature = ConstProp[AMBIENT_TEMPERATURE];
double StefenBoltzmann = 5.67e-8;
double emissivity = ConstProp[EMISSIVITY];
double convection_coefficient = ConstProp[CONVECTION_COEFFICIENT];
const double& T0 = GetGeometry()[0].FastGetSolutionStepValue(rUnknownVar);
const double& T1 = GetGeometry()[1].FastGetSolutionStepValue(rUnknownVar);
const double& q0 =GetGeometry()[0].FastGetSolutionStepValue(rSurfaceSourceVar);
const double& q1 =GetGeometry()[1].FastGetSolutionStepValue(rSurfaceSourceVar);
if (CalculateStiffnessMatrixFlag == true) //calculation of the matrix is required
{
if(rLeftHandSideMatrix.size1() != MatSize )
rLeftHandSideMatrix.resize(MatSize,MatSize,false);
noalias(rLeftHandSideMatrix) = ZeroMatrix(MatSize,MatSize);
rLeftHandSideMatrix(0,0) = ( convection_coefficient + emissivity*StefenBoltzmann*4.0*pow(T0,3) )* 0.5 * lenght;
rLeftHandSideMatrix(1,1) = ( convection_coefficient + emissivity*StefenBoltzmann*4.0*pow(T1,3) )* 0.5 * lenght;
}
//resizing as needed the RHS
double aux = pow(ambient_temperature,4);
if (CalculateResidualVectorFlag == true) //calculation of the matrix is required
{
if(rRightHandSideVector.size() != MatSize )
rRightHandSideVector.resize(MatSize,false);
rRightHandSideVector[0] = q0 - emissivity*StefenBoltzmann*(pow(T0,4) - aux) - convection_coefficient * ( T0 - ambient_temperature);
rRightHandSideVector[1] = q1 - emissivity*StefenBoltzmann*(pow(T1,4) - aux) - convection_coefficient * ( T1 - ambient_temperature);
rRightHandSideVector *= 0.5*lenght;
}
KRATOS_CATCH("")
}
示例8: GetProperties
void TotalLagrangian::InitializeSolutionStep( ProcessInfo& CurrentProcessInfo )
{
for ( unsigned int i = 0; i < mConstitutiveLawVector.size(); i++ )
mConstitutiveLawVector[i]->InitializeSolutionStep( GetProperties(),
GetGeometry(), row( GetGeometry().ShapeFunctionsValues( mThisIntegrationMethod ), i ),
CurrentProcessInfo );
}
示例9: GetGeometry
void BeamElement::CalculateMassMatrix(MatrixType& rMassMatrix, ProcessInfo& rCurrentProcessInfo)
{
KRATOS_TRY
unsigned int dimension = GetGeometry().WorkingSpaceDimension();
unsigned int NumberOfNodes = GetGeometry().size();
unsigned int MatSize = dimension * NumberOfNodes;
if(rMassMatrix.size1() != MatSize)
rMassMatrix.resize(MatSize,MatSize,false);
rMassMatrix = ZeroMatrix(MatSize,MatSize);
//const double& mlength = GetGeometry().Length();
double TotalMass = mArea*mlength*GetProperties()[DENSITY];
Vector LumpFact;
LumpFact = GetGeometry().LumpingFactors(LumpFact);
for(unsigned int i=0; i<NumberOfNodes; i++)
{
double temp = LumpFact[i]*TotalMass;
for(unsigned int j=0; j<dimension; j++)
{
unsigned int index = i*dimension + j;
rMassMatrix(index,index) = temp;
if (index==3 || index==4 || index==5)
rMassMatrix(index,index) = 0.00;
}
}
KRATOS_CATCH("")
}
示例10: drmModeGetCrtc
bool CDRMUtils::GetCrtc()
{
for(auto i = 0; i < m_drm_resources->count_crtcs; i++)
{
m_crtc->crtc = drmModeGetCrtc(m_fd, m_drm_resources->crtcs[i]);
if(m_crtc->crtc->crtc_id == m_encoder->encoder->crtc_id)
{
CLog::Log(LOGDEBUG, "CDRMUtils::%s - found crtc: %d", __FUNCTION__,
m_crtc->crtc->crtc_id);
m_crtc_index = i;
break;
}
drmModeFreeCrtc(m_crtc->crtc);
m_crtc->crtc = nullptr;
}
if(!m_crtc->crtc)
{
CLog::Log(LOGERROR, "CDRMUtils::%s - could not get crtc: %s", __FUNCTION__, strerror(errno));
return false;
}
if (!GetProperties(m_fd, m_crtc->crtc->crtc_id, DRM_MODE_OBJECT_CRTC, m_crtc))
{
CLog::Log(LOGERROR, "CDRMUtils::%s - could not get crtc %u properties: %s", __FUNCTION__, m_crtc->crtc->crtc_id, strerror(errno));
return false;
}
return true;
}
示例11: GetProperties
void FdoOdbcOvClassDefinition::AddProperty(
FdoRdbmsOvPropertyDefinition* pProp
)
{
FdoOdbcOvPropertiesP properties = GetProperties();
properties->Add( dynamic_cast<FdoOdbcOvPropertyDefinition*>(pProp) );
}
示例12: TRACE
STDMETHODIMP CStreamSwitcherAllocator::GetBuffer(
IMediaSample** ppBuffer,
REFERENCE_TIME* pStartTime, REFERENCE_TIME* pEndTime,
DWORD dwFlags)
{
HRESULT hr = VFW_E_NOT_COMMITTED;
if (!m_bCommitted) {
return hr;
}
/*
TRACE(_T("CStreamSwitcherAllocator::GetBuffer m_pPin->m_evBlock.Wait() + %x\n"), this);
m_pPin->m_evBlock.Wait();
TRACE(_T("CStreamSwitcherAllocator::GetBuffer m_pPin->m_evBlock.Wait() - %x\n"), this);
*/
if (m_fMediaTypeChanged) {
if (!m_pPin || !m_pPin->m_pFilter) {
return hr;
}
CStreamSwitcherOutputPin* pOut = (static_cast<CStreamSwitcherFilter*>(m_pPin->m_pFilter))->GetOutputPin();
if (!pOut || !pOut->CurrentAllocator()) {
return hr;
}
ALLOCATOR_PROPERTIES Properties, Actual;
if (FAILED(pOut->CurrentAllocator()->GetProperties(&Actual))) {
return hr;
}
if (FAILED(GetProperties(&Properties))) {
return hr;
}
if (!m_bCommitted || Properties.cbBuffer < Actual.cbBuffer) {
Properties.cbBuffer = Actual.cbBuffer;
if (FAILED(Decommit())) {
return hr;
}
if (FAILED(SetProperties(&Properties, &Actual))) {
return hr;
}
if (FAILED(Commit())) {
return hr;
}
ASSERT(Actual.cbBuffer >= Properties.cbBuffer);
if (Actual.cbBuffer < Properties.cbBuffer) {
return hr;
}
}
}
hr = CMemAllocator::GetBuffer(ppBuffer, pStartTime, pEndTime, dwFlags);
if (m_fMediaTypeChanged && SUCCEEDED(hr)) {
(*ppBuffer)->SetMediaType(&m_mt);
m_fMediaTypeChanged = false;
}
return hr;
}
示例13: GetComponent
// Returns the amount if the component parameter is specified. If the component parameter is nil
// it returns the definition of the component for the given index.
global func GetComponent(id component, int index)
{
// Safety: can only be called from object or definition context.
if (!this || (GetType(this) != C4V_C4Object && GetType(this) != C4V_Def))
return FatalError(Format("GetComponent must be called from object or definition context and not from %v", this));
// Safety: return nil if Components could not be found or are not a proplist.
if (!this.Components || GetType(this.Components) != C4V_PropList)
return;
// If component is specified return the count for that definition.
if (GetType(component) == C4V_Def)
return this.Components[Format("%i", component)];
// Ensure the index is valid.
index = Max(index, 0);
// If component is not specified return the definition of the component at the index.
var cnt = 0;
for (var entry in GetProperties(this.Components))
{
// Check if the entry is an actual valid definition.
var entry_def = GetDefinition(entry);
if (!entry_def)
continue;
if (index == cnt)
return entry_def;
cnt++;
}
return;
}
示例14: GetGeometry
double& AxisymUpdatedLagrangianElement::CalculateTotalMass( double& rTotalMass, const ProcessInfo& rCurrentProcessInfo )
{
KRATOS_TRY
//Compute the Volume Change acumulated:
GeneralVariables Variables;
this->InitializeGeneralVariables(Variables,rCurrentProcessInfo);
const GeometryType::IntegrationPointsArrayType& integration_points = GetGeometry().IntegrationPoints( mThisIntegrationMethod );
rTotalMass = 0;
//reading integration points
for ( unsigned int PointNumber = 0; PointNumber < integration_points.size(); PointNumber++ )
{
//compute element kinematics
this->CalculateKinematics(Variables,PointNumber);
//getting informations for integration
double IntegrationWeight = Variables.detJ * integration_points[PointNumber].Weight();
//compute point volume change
double PointVolumeChange = 0;
PointVolumeChange = this->CalculateVolumeChange( PointVolumeChange, Variables );
rTotalMass += PointVolumeChange * GetProperties()[DENSITY] * 2.0 * 3.141592654 * Variables.CurrentRadius * IntegrationWeight;
}
return rTotalMass;
KRATOS_CATCH( "" )
}
示例15: GetAuthoredProperties
std::vector<UsdProperty>
UsdPrim::_GetPropertiesInNamespace(const std::string &namespaces,
bool onlyAuthored) const
{
// XXX Would be nice to someday plumb the prefix search down through pcp
if (namespaces.empty())
return onlyAuthored ? GetAuthoredProperties() : GetProperties();
const char delim = UsdObject::GetNamespaceDelimiter();
TfTokenVector names = _GetPropertyNames(onlyAuthored, /*applyOrder=*/false);
// Set terminator to the expected position of the delimiter after all the
// supplied namespaces. We perform an explicit test for this char below
// so that we don't need to allocate a new string if namespaces does not
// already end with the delimiter
const size_t terminator = namespaces.size() -
(*namespaces.rbegin() == delim);
// Prune out non-matches before we sort
size_t insertionPt = 0;
for (const auto& name : names) {
const std::string &s = name.GetString();
if (s.size() > terminator &&
TfStringStartsWith(s, namespaces) &&
s[terminator] == delim) {
names[insertionPt++] = name;
}
}
names.resize(insertionPt);
sort(names.begin(), names.end(), TfDictionaryLessThan());
_ApplyOrdering(GetPropertyOrder(), &names);
return _MakeProperties(names);
}