Beispiel #1
0
 public Table(E3Project project, LineTemplate headerLineTemplate, List<string> headerLineTexts, LineTemplate lineTemplate, double bottomLineWidth, StringSeparator separator, TablePageTemplate firstPagetTemplate, TablePageTemplate subsequentPageTemplate = null )
 {
     this.project = project;
     this.firstPageTemplate = firstPagetTemplate;
     if (subsequentPageTemplate == null)
         this.subsequentPageTemplate = firstPagetTemplate;
     else
         this.subsequentPageTemplate = subsequentPageTemplate;
     this.headerLineTemplate = headerLineTemplate;
     this.bottomLineWidth = bottomLineWidth;
     this.headerLineTexts = headerLineTexts;
     this.lineTemplate = lineTemplate;
     this.separator = separator;
     this.graphic = project.GetGraphicById(0);
     this.group = project.GetGroupById(0);
     this.text = project.GetTextById(0);
     currentSheet = project.GetSheetById(0);
     sheetCount = 0;
     sheetIds = new List<int>();
 }
 public void Place(Sheet sheet, Graphic graphic, E3Text text, Group group, Point placePosition)
 {
     E3Font smallFont = new E3Font(height: smallFontHeight, alignment: Alignment.Left);
     E3Font bigFont = new E3Font(height: bigFontHeight, alignment: Alignment.Left);
     List<int> groupIds;
     if (orientation == Orientation.Horizontal)
         groupIds = PlaceHorizontally(sheet, graphic, text, placePosition, smallFont, bigFont);
     else
         groupIds = PlaceVertically(sheet, graphic, text, placePosition, smallFont, bigFont);
     group.CreateGroup(groupIds);
 }
 public void Place(Point placePosition, Sheet sheet, Graphic graphic, Group group, E3Text text)
 {
     PlacedPosition = placePosition;
     double width = 0.2;
     List<int> ids = new List<int>(5);
     double halfBaseLength = triangleBaseLength / 2;
     Point leftBottom = new Point(sheet.MoveLeft(placePosition.X, halfBaseLength), placePosition.Y);
     Point rightBottom = new Point(sheet.MoveRight(placePosition.X, halfBaseLength), placePosition.Y);
     Point top = new Point(placePosition.X, sheet.MoveUp(placePosition.Y, triangleHeight));
     int sheetId = sheet.Id;
     ids.Add(graphic.CreateLine(sheetId, leftBottom.X, leftBottom.Y, rightBottom.X, rightBottom.Y, width));
     ids.Add(graphic.CreateLine(sheetId, leftBottom.X, leftBottom.Y, top.X, top.Y, width));
     ids.Add(graphic.CreateLine(sheetId, rightBottom.X, rightBottom.Y, top.X, top.Y, width));
     ids.Add(text.CreateText(sheetId, description, top.X, sheet.MoveUp(top.Y, descriptionVerticalMargin), font));
     ids.AddRange(CableLayoutById.Values.First().Place(sheet, graphic, placePosition));
     group.CreateGroup(ids);
 }
 private void PlaceSymbols(Sheet sheet, Graphic graphic, Group e3group, E3Text text, Dictionary<int, double> horizontalOffsetById, double startAbsciss, double groupOrdinate)
 {
     double offset = 0;
     foreach (int id in horizontalOffsetById.Keys)
     {
         ISchemeSymbol symbol = symbolById[id];
         offset += horizontalOffsetById[id];
         double absciss = sheet.MoveRight(startAbsciss, offset);
         symbol.Place(new Point(absciss, groupOrdinate), sheet, graphic, e3group, text);
     }
 }
 private void PlaceCableSymbols(Sheet sheet, Graphic graphic, Group e3group, E3Text text, double startAbsciss, double topGroupOrdinate, double bottomGroupOrdinate)
 {
     foreach (int cableId in cableSymbolById.Keys)
     {
         CableSymbol cableSymbol = cableSymbolById[cableId];
         if (cableSymbol.Orientation == Orientation.Horizontal)
         {
             List<int> groupIds = symbolIdsByCableId[cableId];
             groupIds.Sort((id1,id2) => GetGroupPosition(id1).CompareTo(GetGroupPosition(id2)));
             ISchemeSymbol firstSymbol = symbolById[groupIds.First()];
             ISchemeSymbol secondSymbol = symbolById[groupIds.Last()];
             double firstPointX = sheet.MoveRight(firstSymbol.PlacedPosition.X, firstSymbol.RightMargin);
             double y = (firstSymbol.Level == Level.Bottom) ? sheet.MoveDown(bottomGroupOrdinate, bottomGroupBottomMargin) : sheet.MoveDown (topGroupOrdinate, topGroupBottomMargin);
             Point firstPoint = new Point (firstPointX, y);
             double secondPointX = sheet.MoveLeft(secondSymbol.PlacedPosition.X, secondSymbol.LeftMargin);
             Point secondPoint = new Point(secondPointX, y);
             double x = (firstPoint.X + secondPoint.X) / 2;
             double cableSymbolHalfHeight = cableSymbol.Size.Height / 2;
             y = sheet.MoveDown(y, cableSymbolHalfHeight + gridStep);
             cableSymbol.Place(sheet, graphic, text, e3group, new Point(x, y));
          }
     }
     if (topGroupHorizontalOffsetById.Count > 0)
     {
         double top = symbolById[topGroupHorizontalOffsetById.Keys.First()].PlacedPosition.Y;
         ISchemeSymbol bottomSymbol = symbolById[bottomGroupHorizontalOffsetById.Keys.First()];
         double bottom = sheet.MoveUp(bottomSymbol.PlacedPosition.Y, bottomSymbol.TopMargin);
         double center = (top + bottom) / 2;
         foreach (VerticalConnection verticalConnection in verticalConnections)
             foreach (CableSymbol cableSymbol in verticalConnection.VerticalCableSymbols)
             {
                 double y = sheet.MoveDown(center, (cableSymbol.Size.Height - cableSymbol.Diameter) / 2);
                 cableSymbol.Place(sheet, graphic, text, e3group, new Point(sheet.MoveRight(startAbsciss, verticalConnection.OffsetByCableId[cableSymbol.CableId]), y));
             }
     }
 }
 public void Place(Sheet sheet, Graphic graphic, Group e3group, E3Text text, Point placePosition)
 {
     double startAbsciss = sheet.MoveLeft(placePosition.X, Size.Width / 2);
     double startOrdinate = sheet.MoveDown(placePosition.Y, Size.Height / 2);
     double bottomGroupOrdinate = sheet.MoveUp(startOrdinate, bottomGroupsOffset);
     double topGroupOrdinate = sheet.MoveUp(startOrdinate, topGroupsOffset);
     PlaceSymbols(sheet, graphic, e3group, text, topGroupHorizontalOffsetById, startAbsciss, topGroupOrdinate);
     PlaceSymbols(sheet, graphic, e3group, text, bottomGroupHorizontalOffsetById, startAbsciss, bottomGroupOrdinate);
     PlaceCableSymbols(sheet, graphic, e3group, text, startAbsciss, topGroupOrdinate, bottomGroupOrdinate);
     PlaceConnectionLines(sheet, graphic, topGroupOrdinate, bottomGroupOrdinate);
 }
 public void Place(Sheet sheet, Graphic graphic, Group e3group, E3Text text, Point placePositon)
 {
     //layout.Place(sheet, graphic, e3group, text, placePositon);
 }