コード例 #1
0
        /// <summary>
        /// Override function which generates and returns a set of representation 'avatar' objects for the given source object
        /// </summary>
        /// <param name="source"></param>
        /// <returns></returns>
        public override IList <IAvatar> GenerateRepresentations(LinearElement source)
        {
            List <IAvatar> result = new List <IAvatar>();

            if (source != null)
            {
                IMeshAvatar mAv = CreateMeshAvatar();
                mAv.Builder.AddSectionPreview(source);
                mAv.FinalizeMesh();
                result.Add(mAv);
            }
            return(result);
        }
コード例 #2
0
 public override DisplayLayer PreviewLayer(PreviewParameters parameters)
 {
     if (parameters.IsDynamic &&
         parameters.SelectionPoints != null &&
         parameters.SelectionPoints.Count > 2 &&
         parameters.SelectionPoints.ArePlanar())
     {
         ManualDisplayLayer layer   = new ManualDisplayLayer();
         IMeshAvatar        mesh    = layer.CreateMeshAvatar();
         PlanarRegion       pRegion = new PlanarRegion(new PolyLine(parameters.SelectionPoints, true));
         mesh.Builder.AddPanelPreview(pRegion, BuildUp);
         mesh.FinalizeMesh();
         layer.Add(mesh);
         return(layer);
     }
     return(null);
 }
コード例 #3
0
 public override DisplayLayer PreviewLayer(PreviewParameters parameters)
 {
     if (parameters.IsDynamic &&
         parameters.SelectionPoints != null &&
         parameters.SelectionPoints.Count >= 2 &&
         Section != null)
     {
         ManualDisplayLayer layer = new ManualDisplayLayer();
         IMeshAvatar        mesh  = layer.CreateMeshAvatar();
         mesh.Builder.AddSectionPreview(
             new Line(parameters.SelectionPoints[0], parameters.SelectionPoints[1])
             , Section, Orientation);
         mesh.FinalizeMesh();
         layer.Add(mesh);
         return(layer);
     }
     return(null);
 }
コード例 #4
0
        public override IList <IAvatar> GenerateRepresentations(Node source)
        {
            List <IAvatar> result = new List <IAvatar>();

            if (source != null)
            {
                NodeSupport support = source.GetData <NodeSupport>();
                if (support != null && !support.Fixity.AllFalse)
                {
                    double      scale = 0.75;
                    IMeshAvatar mAv   = CreateMeshAvatar();
                    mAv.Builder.AddNodeSupport(source, support, scale);
                    mAv.Brush = new ColourBrush(new Colour(0.8f, 0.8f, 0.2f, 0f)); //TODO: Make customisable
                    mAv.FinalizeMesh();
                    result.Add(mAv);
                }
            }
            return(result);
        }
コード例 #5
0
 public override DisplayLayer PreviewLayer(PreviewParameters parameters)
 {
     if (parameters.IsDynamic && parameters.SelectionPoints != null && parameters.SelectionPoints.Count > 0)
     {
         Vector             cursorPt = parameters.SelectionPoints.Last();
         ManualDisplayLayer layer    = new ManualDisplayLayer();
         var cL = new Line(cursorPt, cursorPt + new Vector(0, 0, Height));
         layer.Add(layer.CreateCurveAvatar(cL));
         if (Section != null)
         {
             IMeshAvatar mesh = layer.CreateMeshAvatar();
             mesh.Builder.AddSectionPreview(cL, Section, Orientation);
             mesh.FinalizeMesh();
             layer.Add(mesh);
         }
         return(layer);
     }
     return(null);
 }