void LineLoad3DCondition::InitializeGeneralVariables(GeneralVariables& rVariables, const ProcessInfo& rCurrentProcessInfo) { ForceLoadCondition::InitializeGeneralVariables(rVariables, rCurrentProcessInfo); //calculating the current jacobian from cartesian coordinates to parent coordinates for all integration points [dx_n+1/d£] rVariables.j = GetGeometry().Jacobian( rVariables.j, mThisIntegrationMethod ); //Calculate Delta Position rVariables.DeltaPosition = CalculateDeltaPosition(rVariables.DeltaPosition); ///calculating the reference jacobian from cartesian coordinates to parent coordinates for all integration points [dx_n/d£] rVariables.J = GetGeometry().Jacobian( rVariables.J, mThisIntegrationMethod, rVariables.DeltaPosition ); }
void UserPromptView::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw) { nux::Geometry const& geo = GetGeometry(); graphics_engine.PushClippingRectangle(geo); if (!IsFullRedraw()) { bg_layer_.reset(CrateBackgroundLayer(geo.width, geo.height)); nux::GetPainter().PushLayer(graphics_engine, geo, bg_layer_.get()); } if (caps_lock_on_) { for (auto const& text_entry : focus_queue_) PaintWarningIcon(graphics_engine, text_entry->GetGeometry()); if (focus_queue_.empty()) PaintWarningIcon(graphics_engine, cached_focused_geo_); } if (GetLayout()) GetLayout()->ProcessDraw(graphics_engine, force_draw); if (!IsFullRedraw()) nux::GetPainter().PopBackground(); graphics_engine.PopClippingRectangle(); }
bool mitk::GeometryData::VerifyRequestedRegion() { if (GetGeometry() == nullptr) return false; return true; }
bool mitk::GeometryData::RequestedRegionIsOutsideOfTheBufferedRegion() { if (GetGeometry() != nullptr) return true; return false; }
void BeamElement::CalculateAll(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector,ProcessInfo& rCurrentProcessInfo, bool CalculateStiffnessMatrixFlag,bool CalculateResidualVectorFlag) { KRATOS_TRY unsigned int dimension = GetGeometry().WorkingSpaceDimension(); if (dimension != 3) { std::cout<<"this element works only with a 2 node line and 3D dimension"<<std::endl; return; } if (CalculateStiffnessMatrixFlag == true) { CalculateLHS(rLeftHandSideMatrix); } if (CalculateResidualVectorFlag == true) { CalculateRHS(rRightHandSideVector); } KRATOS_CATCH("") }
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( "" ) }
Condition::Pointer SlaveContactFace3DNewmark::Create( IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const { return Condition::Pointer( new SlaveContactFace3DNewmark(NewId, GetGeometry().Create(ThisNodes), pProperties)); }
//************************************************************************************ //************************************************************************************ Element::Pointer MeshlessBaseElement::Create( IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const { return Element::Pointer(new MeshlessBaseElement(NewId, GetGeometry().Create(ThisNodes), pProperties)); }
AxisymUpdatedLagrangianElement::AxisymUpdatedLagrangianElement( IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties ) : LargeDisplacementElement( NewId, pGeometry, pProperties ) { mThisIntegrationMethod = GetGeometry().GetDefaultIntegrationMethod(); //mThisIntegrationMethod = GeometryData::GI_GAUSS_1; //mThisIntegrationMethod = GeometryData::GI_GAUSS_2; }
void MoviePreview::PreLayoutManagement() { nux::Geometry geo = GetGeometry(); previews::Style& style = dash::previews::Style::Instance(); nux::Geometry geo_art(geo.x, geo.y, style.GetVideoImageAspectRatio() * geo.height, geo.height); int content_width = geo.width - style.GetPanelSplitWidth().CP(scale) - style.GetDetailsLeftMargin().CP(scale) - style.GetDetailsRightMargin().CP(scale); if (content_width - geo_art.width < style.GetDetailsPanelMinimumWidth().CP(scale)) geo_art.width = std::max(0, content_width - style.GetDetailsPanelMinimumWidth().CP(scale)); image_->SetMinMaxSize(geo_art.width, geo_art.height); int details_width = std::max(0, geo.width - geo_art.width - style.GetPanelSplitWidth().CP(scale) - style.GetDetailsLeftMargin().CP(scale) - style.GetDetailsRightMargin().CP(scale)); if (title_) { title_->SetMaximumWidth(details_width); } if (subtitle_) { subtitle_->SetMaximumWidth(details_width); } if (description_) { description_->SetMaximumWidth(details_width); } for (nux::AbstractButton* button : action_buttons_) { button->SetMinMaxSize(CLAMP((details_width - style.GetSpaceBetweenActions().CP(scale)) / 2, 0, style.GetActionButtonMaximumWidth().CP(scale)), style.GetActionButtonHeight().CP(scale)); } Preview::PreLayoutManagement(); }
void MusicPaymentPreview::PreLayoutManagement() { nux::Geometry const& geo = GetGeometry(); GetLayout()->SetGeometry(geo); previews::Style& style = dash::previews::Style::Instance(); int content_width = geo.width - style.GetPanelSplitWidth().CP(scale) - style.GetDetailsLeftMargin().CP(scale) - style.GetDetailsRightMargin().CP(scale); int width = std::max<int>(0, content_width); if(full_data_layout_) { full_data_layout_->SetMaximumWidth(width); } if(header_layout_) { header_layout_->SetMaximumWidth(width); } if(intro_) { intro_->SetMaximumWidth(width); } if(form_layout_) { form_layout_->SetMaximumWidth(width); } if(footer_layout_) { footer_layout_->SetMaximumWidth(width); } // set the tab ordering SetFirstInTabOrder(password_entry_->text_entry()); SetLastInTabOrder(buttons_map_[MusicPaymentPreview::CANCEL_PURCHASE_ACTION].GetPointer()); SetLastInTabOrder(buttons_map_[MusicPaymentPreview::PURCHASE_ALBUM_ACTION].GetPointer()); SetLastInTabOrder(buttons_map_[MusicPaymentPreview::CHANGE_PAYMENT_ACTION].GetPointer()); SetLastInTabOrder(buttons_map_[MusicPaymentPreview::FORGOT_PASSWORD_ACTION].GetPointer()); Preview::PreLayoutManagement(); }
// Destructor Cluster3D::~Cluster3D() { if (GetProperties()[BREAKABLE_CLUSTER]) { for (unsigned int i = 0; i < mListOfCoordinates.size(); i++) { mListOfSphericParticles[i]->Set(DEMFlags::BELONGS_TO_A_CLUSTER, false); mListOfSphericParticles[i]->GetGeometry()[0].Set(DEMFlags::BELONGS_TO_A_CLUSTER, false); } GetGeometry()[0].Set(TO_ERASE, true); } else{ for (unsigned int i = 0; i < mListOfCoordinates.size(); i++) { mListOfSphericParticles[i]->Set(DEMFlags::BELONGS_TO_A_CLUSTER, false); mListOfSphericParticles[i]->GetGeometry()[0].Set(DEMFlags::BELONGS_TO_A_CLUSTER, false); mListOfSphericParticles[i]->Set(TO_ERASE, true); } } mListOfSphericParticles.clear(); mListOfCoordinates.clear(); mListOfRadii.clear(); if (mpIntegrationScheme!=NULL) { delete mpIntegrationScheme; } }
void ResizingBaseWindow::UpdateInputWindowGeometry() { #ifdef USE_X11 if (m_input_window && m_input_window_enabled) m_input_window->SetGeometry(input_adjustment_(GetGeometry())); #endif }
void HSeparator::Draw(nux::GraphicsEngine &GfxContext, bool force_draw) { nux::Geometry const& base = GetGeometry(); int y0 = base.y + base.GetHeight() / 2; unsigned int alpha = 0, src = 0, dest = 0; GfxContext.GetRenderStates().GetBlend(alpha, src, dest); nux::GetGraphicsDisplay()->GetGraphicsEngine()->GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); if (base.GetWidth() - 2 * border_size_ > 0) { nux::Color color0 = color_ * alpha0_; nux::Color color1 = color_ * alpha1_; nux::GetPainter().Draw2DLine(GfxContext, base.x, y0, base.x + border_size_, y0, color0, color1); nux::GetPainter().Draw2DLine(GfxContext, base.x + border_size_, y0, base.x + base.GetWidth() - border_size_, y0, color1, color1); nux::GetPainter().Draw2DLine(GfxContext, base.x + base.GetWidth() - border_size_, y0, base.x + base.GetWidth(), y0, color1, color0); } else { nux::Color color1 = color_ * alpha1_; nux::GetPainter().Draw2DLine(GfxContext, base.x, y0, base.x + base.GetWidth(), y0, color1, color1); } GfxContext.GetRenderStates().SetBlend(alpha, src, dest); }
//************************************************************************************ //************************************************************************************ void UpdatedLagrangianFluid3Dinc::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& CurrentProcessInfo) { unsigned int number_of_nodes = GetGeometry().PointsNumber(); unsigned int dim = 3; if(rResult.size() != number_of_nodes*dim) rResult.resize(number_of_nodes*dim,false); for (unsigned int i=0; i<number_of_nodes; i++) { rResult[i*dim] = GetGeometry()[i].GetDof(DISPLACEMENT_X).EquationId(); rResult[i*dim+1] = GetGeometry()[i].GetDof(DISPLACEMENT_Y).EquationId(); rResult[i*dim+2] = GetGeometry()[i].GetDof(DISPLACEMENT_Z).EquationId(); } }
bool FdoRdbmsSQLDataReader::IsNull(FdoInt32 index) { bool isNull = true; if( ! mHasMoreRows ) throw FdoCommandException::Create(NlsMsgGet(FDORDBMS_62, noMoreRows)); ValidateIndex(index); switch(mColList[index].datatype) { case RDBI_GEOMETRY: { FdoInt32 len = 0; GetGeometry(index, &len, true); isNull = (len == 0); } break; case RDBI_BLOB_ULEN: case RDBI_WSTRING_ULEN: case RDBI_STRING_ULEN: { FdoByteArray* arr = NULL; bool isNullArr = false; mQueryResult->GetBinaryValue (index+1, sizeof(FdoByteArray*), (char*)&arr, &isNullArr, NULL); isNull = (isNullArr || arr == NULL || arr->GetCount() == 0); } break; default: isNull = mQueryResult->GetIsNull(index+1); break; } return isNull; }
void ApplicationPreview::PreLayoutManagement() { nux::Geometry geo = GetGeometry(); previews::Style& style = dash::previews::Style::Instance(); nux::Geometry geo_art(geo.x, geo.y, style.GetAppImageAspectRatio() * geo.height, geo.height); if (geo.width - geo_art.width - style.GetPanelSplitWidth() - style.GetDetailsLeftMargin() - style.GetDetailsRightMargin() < style.GetDetailsPanelMinimumWidth()) geo_art.width = MAX(0, geo.width - style.GetPanelSplitWidth() - style.GetDetailsLeftMargin() - style.GetDetailsRightMargin() - style.GetDetailsPanelMinimumWidth()); image_->SetMinMaxSize(geo_art.width, geo_art.height); int details_width = MAX(0, geo.width - geo_art.width - style.GetPanelSplitWidth() - style.GetDetailsLeftMargin() - style.GetDetailsRightMargin()); int top_app_info_max_width = MAX(0, details_width - style.GetAppIconAreaWidth() - style.GetSpaceBetweenIconAndDetails()); if (title_) { title_->SetMaximumWidth(top_app_info_max_width); } if (subtitle_) { subtitle_->SetMaximumWidth(top_app_info_max_width); } if (license_) { license_->SetMaximumWidth(top_app_info_max_width); } if (last_update_) { last_update_->SetMaximumWidth(top_app_info_max_width); } if (copywrite_) { copywrite_->SetMaximumWidth(top_app_info_max_width); } if (description_) { description_->SetMaximumWidth(details_width); } for (nux::AbstractButton* button : action_buttons_) { button->SetMinMaxSize(CLAMP((details_width - style.GetSpaceBetweenActions()) / 2, 0, style.GetActionButtonMaximumWidth()), style.GetActionButtonHeight()); } Preview::PreLayoutManagement(); }
Condition::Pointer MasterContactPoint2D::Create( IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const { return Condition::Pointer( new MasterContactPoint2D(NewId, GetGeometry().Create(ThisNodes), pProperties)); }
void LineLoad3DCondition::CalculateKinematics(GeneralVariables& rVariables, const double& rPointNumber) { KRATOS_TRY //Get the shape functions for the order of the integration method [N] const Matrix& Ncontainer = rVariables.GetShapeFunctions(); //get first vector of the plane rVariables.Tangent1[0] = rVariables.J[rPointNumber](0, 0); // x_1,e rVariables.Tangent1[1] = rVariables.J[rPointNumber](1, 0); // x_2,e rVariables.Tangent1[2] = rVariables.J[rPointNumber](2, 0); // x_3,e //normal in the x-y plane (must be generalized) rVariables.Normal[0] = -rVariables.J[rPointNumber](1, 0); //-x_2,e rVariables.Normal[1] = rVariables.J[rPointNumber](0, 0); // x_1,e rVariables.Normal[2] = rVariables.J[rPointNumber](2, 0); // x_3,e //Jacobian to the last known configuration rVariables.Jacobian = norm_2(rVariables.Tangent1); //Set Shape Functions Values for this integration point rVariables.N =row( Ncontainer, rPointNumber); //Get domain size rVariables.DomainSize = GetGeometry().Length(); KRATOS_CATCH( "" ) }
void KVGeoImport::ImportGeometry(Double_t dTheta, Double_t dPhi, Double_t ThetaMin, Double_t PhiMin, Double_t ThetaMax, Double_t PhiMax) { // Scan the geometry in order to find all detectors and detector alignments. // This is done by sending out "particles" from (0,0,0) in all directions between // (ThetaMin,ThetaMax) - with respect to Z-axis - and (PhiMin,PhiMax) - cylindrical // angle in the (X,Y)-plane, over a grid of step dTheta in Theta and dPhi in Phi. KVEvent* evt = new KVEvent(); KVNucleus* nuc = evt->AddParticle(); nuc->SetZAandE(1,1,1); Double_t theta,phi; Int_t count=0; // note that ImportGeometry can be called for a KVMultiDetArray // which already contains detectors, groups and id telescopes fGroupNumber=fArray->GetStructureTypeList("GROUP")->GetEntries(); Int_t ndets0 = fArray->GetDetectors()->GetEntries(); Int_t idtels0 = fArray->GetListOfIDTelescopes()->GetEntries(); for(theta=ThetaMin; theta<=ThetaMax; theta+=dTheta){ for(phi=PhiMin; phi<=PhiMax; phi+=dPhi){ nuc->SetTheta(theta); nuc->SetPhi(phi); fCurrentGroup = 0; fLastDetector = 0; PropagateEvent(evt); count++; } } // make sure detector nodes are correct TIter next(fArray->GetDetectors()); KVDetector*d; while( (d=(KVDetector*)next()) ) d->GetNode()->RehashLists(); // set up all detector node trajectories //fArray->CalculateGeoNodeTrajectories(); if(fCreateArray){ fArray->SetGeometry(GetGeometry()); KVGeoNavigator* nav = fArray->GetNavigator(); nav->SetDetectorNameFormat(fDetNameFmt); for(register int i=0; i<fStrucNameFmt.GetEntries(); i++){ KVNamedParameter* fmt = fStrucNameFmt.GetParameter(i); nav->SetStructureNameFormat(fmt->GetName(), fmt->GetString()); } nav->SetNameCorrespondanceList(fDetStrucNameCorrespList); fArray->CalculateDetectorSegmentationIndex(); } Info("ImportGeometry", "Tested %d directions - Theta=[%f,%f:%f] Phi=[%f,%f:%f]",count,ThetaMin,ThetaMax,dTheta,PhiMin,PhiMax,dPhi); Info("ImportGeometry", "Imported %d detectors into array", fArray->GetDetectors()->GetEntries()-ndets0); if(fCreateArray){ fArray->CreateIDTelescopesInGroups(); Info("ImportGeometry", "Created %d identification telescopes in array", fArray->GetListOfIDTelescopes()->GetEntries()-idtels0); } }
void OverlaySpinner::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) { nux::Geometry const& geo = GetGeometry(); nux::TexCoordXForm texxform; GfxContext.PushClippingRectangle(geo); nux::GetPainter().PaintBackground(GfxContext, geo); texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); texxform.min_filter = nux::TEXFILTER_LINEAR; texxform.mag_filter = nux::TEXFILTER_LINEAR; unsigned int current_alpha_blend; unsigned int current_src_blend_factor; unsigned int current_dest_blend_factor; GfxContext.GetRenderStates().GetBlend(current_alpha_blend, current_src_blend_factor, current_dest_blend_factor); GfxContext.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); nux::Geometry spin_geo(geo.x + ((geo.width - spin_->GetWidth()) / 2), geo.y + ((geo.height - spin_->GetHeight()) / 2), spin_->GetWidth(), spin_->GetHeight()); // Geometry (== Rect) uses integers which were rounded above, // hence an extra 0.5 offset for odd sizes is needed // because pure floating point is not being used. int spin_offset_w = !(geo.width % 2) ? 0 : 1; int spin_offset_h = !(geo.height % 2) ? 0 : 1; nux::Matrix4 matrix_texture; matrix_texture = nux::Matrix4::TRANSLATE(-spin_geo.x - (spin_geo.width + spin_offset_w) / 2.0f, -spin_geo.y - (spin_geo.height + spin_offset_h) / 2.0f, 0) * matrix_texture; matrix_texture = rotate_ * matrix_texture; matrix_texture = nux::Matrix4::TRANSLATE(spin_geo.x + (spin_geo.width + spin_offset_w) / 2.0f, spin_geo.y + (spin_geo.height + spin_offset_h) / 2.0f, 0) * matrix_texture; GfxContext.SetModelViewMatrix(GfxContext.GetModelViewMatrix() * matrix_texture); GfxContext.QRP_1Tex(spin_geo.x, spin_geo.y, spin_geo.width, spin_geo.height, spin_->GetDeviceTexture(), texxform, nux::color::White); // revert to model view matrix stack GfxContext.ApplyModelViewMatrix(); GfxContext.PopClippingRectangle(); GfxContext.GetRenderStates().SetBlend(current_alpha_blend, current_src_blend_factor, current_dest_blend_factor); if (!frame_timeout_) { frame_timeout_.reset(new glib::Timeout(22, sigc::mem_fun(this, &OverlaySpinner::OnFrameTimeout))); } }
//*********************************************************************************** //*********************************************************************************** PointLoad2DCondition::PointLoad2DCondition(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties) : PointLoad3DCondition(NewId, pGeometry, pProperties) { mThisIntegrationMethod = GetGeometry().GetDefaultIntegrationMethod(); //DO NOT ADD DOFS HERE!!! }
const mitk::Geometry3D* mitk::BaseData::GetUpdatedGeometry(int t) { SetRequestedRegionToLargestPossibleRegion(); UpdateOutputInformation(); return GetGeometry(t); }
void Polygon::Scale(const Coordinate &OriginPt,double dx,double dy) { for(long i=0;i<GeometryCount();i++) { GetGeometry(i)->Scale(OriginPt,dx,dy); } }
//************************************************************************************ //************************************************************************************ // this subroutine calculates the nodal contributions for the explicit steps of the // fractional step procedure void UpdatedLagrangianFluid3Dinc::InitializeSolutionStep(ProcessInfo& CurrentProcessInfo) { KRATOS_TRY //save original Area mA0 = GeometryUtils::CalculateVolume3D(GetGeometry()); KRATOS_CATCH(""); }
//************************************************************************************ //************************************************************************************ void Monolithic2DNeumann::GetDofList(DofsVectorType& ElementalDofList,ProcessInfo& CurrentProcessInfo) { KRATOS_TRY unsigned int number_of_nodes = GetGeometry().PointsNumber(); unsigned int dim = 2; unsigned int node_size = dim; if(ElementalDofList.size() != number_of_nodes*node_size) ElementalDofList.resize(number_of_nodes*node_size); for (unsigned int i=0; i<number_of_nodes; i++) { ElementalDofList[i*node_size] = GetGeometry()[i].pGetDof(VELOCITY_X); ElementalDofList[i*node_size+1] = GetGeometry()[i].pGetDof(VELOCITY_Y); } KRATOS_CATCH(""); }
void Polygon::Rotate(const GEOMETRY::geom::Coordinate &OriginPt, double angle) { for(long i=0;i<GeometryCount();i++) { GetGeometry(i)->Rotate(OriginPt,angle); } }
//*********************************************************************************** //*********************************************************************************** void FaceForce3D::GetFirstDerivativesVector( Vector& values, int Step ) { unsigned int number_of_nodes = GetGeometry().size(); unsigned int MatSize = number_of_nodes * 3; if ( values.size() != MatSize ) values.resize( MatSize ); for ( unsigned int i = 0; i < number_of_nodes; i++ ) { const array_1d<double, 3>& vel = GetGeometry()[i].FastGetSolutionStepValue( VELOCITY, Step ); unsigned int index = i * 3; values[index] = vel[0]; values[index+1] = vel[1]; values[index+2] = vel[2]; } }
/** * calculates only the RHS vector (certainly to be removed due to contact algorithm) */ void MasterContactPoint2D::CalculateRightHandSide( VectorType& rRightHandSideVector, ProcessInfo& rCurrentProcessInfo) { unsigned int ndof = GetGeometry().size()*2; if( rRightHandSideVector.size() != ndof ) rRightHandSideVector.resize(ndof,false); rRightHandSideVector = ZeroVector(ndof); }
TotalLagrangian::TotalLagrangian( IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties ) : Element( NewId, pGeometry, pProperties ) { // const unsigned int dim = GetGeometry().WorkingSpaceDimension(); mThisIntegrationMethod = GetGeometry().GetDefaultIntegrationMethod(); }