//Method to enable feet of unit whose on floor private void EnableUnitFloorDetails() { Articles articles = this.CurrentAppli.GetArticleList(KD.Analysis.FilterArticle.filterToGetArticleByCodeValidPlaced_Plus(manageCatalog.catalogCode, KD.SDK.SceneEnum.ObjectInfo.TYPE, (int)KD.SDK.SceneEnum.ObjectType.LINEAR)); foreach (Article article in articles) { SegmentClassification segmentClassification = new SegmentClassification(article); if (segmentClassification.IsArticlePlinth()) { string articleOverlapping = this.CurrentAppli.SceneComponent.ObjectGetOverlappingObjectsList(article.ObjectId, false); string[] articleOverlappingIDs = articleOverlapping.Split(KD.CharTools.Const.Comma); foreach (string id in articleOverlappingIDs) { Article articleToDelDetails = new Article(this.CurrentAppli, id); segmentClassification = new SegmentClassification(articleToDelDetails); if (segmentClassification.IsArticleUnitFloor()) { this.CurrentAppli.Scene.ObjectSetInfo(Convert.ToInt32(id), KD.StringTools.Const.Zero, KD.SDK.SceneEnum.ObjectInfo.HASVISIBLEDETAILS); } } } } }
private Articles SupplierArticleValidInScene() { Articles articles = new Articles(); string supplierId = orderInformations.GetSupplierName(); string IDs = String.Empty; int objSupplierNb = this.GetObjectNbFromHeading(); if (objSupplierNb > 0) { for (int rank = 0; rank < objSupplierNb; rank++) { int objId = this.CurrentAppli.Scene.SupplierGetObjectId(supplierId, (int)KD.SDK.SceneEnum.ObjectList.ALLHEADINGS, false, rank); IDs += objId + KD.StringTools.Const.Comma; } //Get all supplier articles of all heading except linears Articles supplierArticles = new Articles(CurrentAppli, IDs); foreach (Article article in supplierArticles) { SegmentClassification segmentClassification = new SegmentClassification(article); if (article.IsValid && article.Type != 17 && !String.IsNullOrEmpty(article.Ref)) //&& !segmentClassification.IsArticleLinear()) // { articles.Add(article); } } //Must relist the articles, del linears and add graphic linear articles = this.DelLinearsArticles(articles); //add linear articles cause not in heading and need to all real object in the scene articles = this.AddLinearsGraphikArticles(articles); } return(articles); }
public override int GetHashCode() { int hash = 1; if (ConfidenceThreshold != 0F) { hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ConfidenceThreshold); } if (MaxPredictions != 0) { hash ^= MaxPredictions.GetHashCode(); } if (SegmentClassification != false) { hash ^= SegmentClassification.GetHashCode(); } if (ShotClassification != false) { hash ^= ShotClassification.GetHashCode(); } if (OneSecIntervalClassification != false) { hash ^= OneSecIntervalClassification.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public int GetArticlePolyType(Article article) { SegmentClassification segmentClassification = new SegmentClassification(article); int type = Convert.ToInt16(this.CurrentAppli.Scene.ObjectGetInfo(article.ObjectId, KD.SDK.SceneEnum.ObjectInfo.TYPE)); if (type == (int)(KD.SDK.SceneEnum.ObjectType.PLANARTICLE) && segmentClassification.IsArticleWorkTop()) { PolytypeValue polytypeValue = new PolytypeValue(PolytypeValue.Polytype_WorkTop); return(PolytypeValue.Polytype_WorkTop); } else if ((type == (int)(KD.SDK.SceneEnum.ObjectType.STANDARD) || type == (int)(KD.SDK.SceneEnum.ObjectType.LINEAR)) && segmentClassification.IsArticlePlinth()) { PolytypeValue polytypeValue = new PolytypeValue(PolytypeValue.Polytype_Base); return(PolytypeValue.Polytype_Base); } else if ((type == (int)(KD.SDK.SceneEnum.ObjectType.STANDARD) || type == (int)(KD.SDK.SceneEnum.ObjectType.LINEAR)) && segmentClassification.IsArticleLightPelmet()) { PolytypeValue polytypeValue = new PolytypeValue(PolytypeValue.Polytype_LightPelmet); return(PolytypeValue.Polytype_LightPelmet); } else if ((type == (int)(KD.SDK.SceneEnum.ObjectType.STANDARD) || type == (int)(KD.SDK.SceneEnum.ObjectType.LINEAR)) && segmentClassification.IsArticleCornice()) { PolytypeValue polytypeValue = new PolytypeValue(PolytypeValue.Polytype_Cornice); return(PolytypeValue.Polytype_Cornice); } return(KD.Const.UnknownId); }
private void MoveArticlePositionZPlinth() { SegmentClassification segmentClassification = new SegmentClassification(this.Article); if (!segmentClassification.IsArticlePlinth()) { if (this.Article.PositionZ != (double)this.RefPntZ) { double gap = this.Article.PositionZ - (double)this.RefPntZ; _article.PositionZ -= gap; } } }
private Articles DelLinearsArticles(Articles articles) { Articles articlesReturn = new Articles(articles); foreach (Article article in articles) { SegmentClassification segmentClassification = new SegmentClassification(article); if (segmentClassification.IsArticleLinear()) { articlesReturn.Remove(article); } } return(articlesReturn); }
private Articles AddLinearsGraphikArticles(Articles articles) { string IDs = this.CurrentAppli.SceneComponent.SceneGetObjectIdList(null, KD.Analysis.FilterArticle.strFilterToGetValidPlacedParent());//strFilterToGetValidPlacedHostedAndChildren Articles articlesList = new Articles(CurrentAppli, IDs); foreach (Article article in articlesList) { SegmentClassification segmentClassification = new SegmentClassification(article); if (segmentClassification.IsArticleLinear())// && !article.HasParent()) // && article.IsValid { if (!articles.Contains(article)) { articles.Add(article); } } } return(articles); }
//private void PlaceHindranceInScene() //{ // foreach (string hindranceSection in this.TypeSectionsList(SegmentName.Hindrance_)) // { // hindranceSegment = new DoorSegment(this, this.CurrentFileEGI, hindranceSection); // hindranceSegment.Add(); // } //} private void PlaceArticlesInScene() { #region //INFO //placer les objets //Manufacturer = 35 //RefNo = 1844 //RefPos = 1.0 //Shape = 1 #endregion foreach (string articleSection in articleSectionList) { mainForm.SetProgressBar(articleSection, allSectionsCount); articleSegment = new ArticleSegment(this, this.CurrentFileEGI, articleSection, manageCatalog); SegmentClassification segmentClassification = new SegmentClassification(articleSection, this.CurrentFileEGI); List <string> catalogsList = manageCatalog.CatalogsByManufacturerList(articleSegment.Manufacturer); if (segmentClassification.HasSectionPolytype()) { articleSegment.AddLinear(articleSection, catalogsList); } else { articleSegment.Add(articleSection, catalogsList); } this.ResetReference(); } if (articleSegment != null) { //articleSegment.PlacedArticleMessage(); articleSegment.NoPlacedArticleMessage(); } }
public OrderInformations(Article article, SegmentClassification segmentClassification) { _article = article; _segmentClassification = segmentClassification; }
// i must organise SHAPE when 20 = filer, 27 = angle (file IDM17_sous-version2_Partie3_fr_nouvelleversion) public void Add(string section, List <string> catalogsList) { _manageCatalog.SetLastManufacturerCatalog(catalogsList); if (!String.IsNullOrEmpty(_manageCatalog.CatalogManufacturer)) { Article component = this.PlaceComponentObject(); if (component != null && component.IsValid) { _article = component; this.AddPlacedArticleDicts(component);//, this.RefPos this.DeSelectArticle(); return; } else { this.CatalogManufacturer = _manageCatalog.CatalogManufacturer; _article = this.PlaceObject(); if (this.Article != null && this.Article.IsValid) { SegmentClassification segmentClassification = new SegmentClassification(this.Article, _section, _currentFileEGI); if (segmentClassification.IsSectionCorner() && segmentClassification.IsArticleFiler()) //shape 20 and filer { if (segmentClassification.HasSectionCoin()) { _name += CatalogBlockName.Coin; _commentName += CatalogBlockName.Coin; _article = this.ReplaceObject(); if (this.Article != null) { if (this.Article.KeyRef.ToUpper().Contains(CatalogBlockName.Coin.ToUpper())) { this.ChangeFilerDimensions(); this.ChangeFilerChildDimensions(); } else { this.MoveArticlePerRepere(this.Shape); this.MoveArticlePositionZPlinth(); } } } else { this.ChangeFilerPositions(); } } else { if (segmentClassification.IsArticleUnit() && !segmentClassification.IsArticleSplashbackPanel()) { if (!segmentClassification.IsArticleSplashbackPanel2()) { this.ChangeCarcasseDimY(this.Shape); _article.DeleteFromScene(); _article = this.PlaceObject(); } } this.MoveArticlePerRepere(this.Shape); this.MoveArticlePositionZPlinth(); } if (segmentClassification.IsSectionAngleWithFiler()) //shape 27 angle { this.SetAngleDimensionsFromEGI(); this.SetAngleChildDimensions(); this.SetAnglePositionAngle(); } this.AddPlacedArticleDicts(this.Article);//, this.RefPos this.DeSelectArticle(); } else { if (catalogsList.Count > 1) { catalogsList.Remove(_manageCatalog.CatalogManufacturer); this.Add(section, catalogsList); } else { ImportObject.articleNotPlacedList.Add(this.Name); } } } } }
public string[] GetArticlePolyPoint(Article article) { SegmentClassification segmentClassification = new SegmentClassification(article); string shapePointList = String.Empty; string newShapePointList = string.Empty; this.SetSceneReference(OrderWrite.version); shapePointList = segmentClassification.GetShape(); if (String.IsNullOrEmpty(shapePointList)) { if (segmentClassification.IsArticlePlinth()) { if (article.HasParent()) { SegmentClassification segmentParentClassification = new SegmentClassification(article.Parent); if (segmentParentClassification.IsArticlePlinth()) { shapePointList = segmentParentClassification.GetShape(); } } else { Articles childs = article.GetChildren(FilterArticle.strFilterToGetValidPlacedHostedAndChildren()); if (childs.Count > 0) { foreach (Article child in childs) { SegmentClassification segmentChildClassification = new SegmentClassification(child); if (segmentChildClassification.IsArticlePlinth()) { shapePointList = segmentChildClassification.GetShape(); } } } } } } if (!String.IsNullOrEmpty(shapePointList)) { string[] points = shapePointList.Split(KD.CharTools.Const.SemiColon); // 5 pts foreach (string point in points) { string[] coords = point.Split(KD.CharTools.Const.Comma); if (coords.Length > 3) { newShapePointList += Convert.ToString(KD.StringTools.Convert.ToDouble(coords[0]) - _sceneDimX) + KD.CharTools.Const.Comma; newShapePointList += Convert.ToString(KD.StringTools.Convert.ToDouble(coords[1]) - _sceneDimY) + KD.CharTools.Const.Comma; newShapePointList += Convert.ToString(KD.StringTools.Convert.ToDouble(coords[2]) - _sceneDimZ) + KD.CharTools.Const.Comma; newShapePointList += coords[3] + KD.CharTools.Const.SemiColon; } } string[] shapeList = newShapePointList.Split(KD.CharTools.Const.SemiColon); if (shapeList.Length > 0) { //Determine the position for linear because in Insitu is 0,0 and we need the first shape point. if (segmentClassification.IsArticleLinear() || segmentClassification.IsArticleWorkTop()) { OrderWrite.posX = KD.StringTools.Convert.ToDouble(shapeList[0].Split(KD.CharTools.Const.Comma)[0]); OrderWrite.posY = KD.StringTools.Convert.ToDouble(shapeList[0].Split(KD.CharTools.Const.Comma)[1]); } return(shapeList); } } return(null); }