Esempio n. 1
0
        public Search(IAnalyticsMember member, MeasureType measure, DimensionType dimension, bool hasOtherSuggestions = false, string originalQuery = null)
        {
            Name = member.Name;
            UniqueName = member.UniqueName;
            Type = MemberMeta.GetMemberType(member);
            Format = AnalyticsCache.FormatFromType(measure);

            HasOtherSuggestions = hasOtherSuggestions;
            OriginalQuery = originalQuery;

            try {
                var customSearch = new GoogleCache();
                GoogleResults = customSearch.Search(member.Name).Select(x => new GoogleResult(x));
            } catch(Exception ex) {
                // Not paying for google search so this can throw a Not Authorized
            }

            var analyticsCache = new AnalyticsCache();
            ValueByWeek = analyticsCache.GetMesaureByDimension(member, dimension, measure).Cast<IMeasureByTimeDimension>();

            var dataWarehouseCache = new DataWarehouseCache();
            TopProjects = dataWarehouseCache.GetTopProjects(member.Name, this.EndDate);

            switch (Type) {
                case MemberType.County:
                    Extent = dataWarehouseCache.GetCountyExtent(member.Name);
                    break;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a new ContextDimensionInfo.
 /// </summary>
 /// <param name="copy">The ContextDimensionInfo object to be copied.</param>
 public ContextDimensionInfo(ContextDimensionInfo copy)
 {
     this.Id = copy.Id;
     this.dimensionId = copy.dimensionId;
     this.type = copy.type;
     this.dimensionNode = copy.dimensionNode;//this is a shallow copy
 }
Esempio n. 3
0
 public virtual void OnLayoutNegotiated(float size, DimensionType dimension)
 {
     Interop.CustomActorImpl.CustomActorImpl_OnLayoutNegotiated(swigCPtr, size, (int)dimension);
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 4
0
 internal void SetResizePolicy(ResizePolicyType policy, DimensionType dimension)
 {
     Interop.Actor.Actor_SetResizePolicy(swigCPtr, (int)policy, (int)dimension);
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 /// <summary>
 /// Create a new price component defining the pricing of a tariff.
 /// </summary>
 /// <param name="Type">Type of tariff dimension.</param>
 /// <param name="Price">Price per unit for this tariff dimension.</param>
 /// <param name="StepSize">Minimum amount to be billed. This unit will be billed in this step_size blocks.</param>
 public PriceComponent(DimensionType  Type,
                       Decimal        Price,
                       UInt32         StepSize = 1)
 {
     this.Type      = Type;
     this.Price     = Price;
     this.StepSize  = StepSize;
 }
Esempio n. 6
0
 /// <summary>
 /// Create a new price component defining the pricing of a tariff.
 /// </summary>
 /// <param name="Type">Type of tariff dimension.</param>
 /// <param name="Price">Price per unit for this tariff dimension.</param>
 /// <param name="StepSize">Minimum amount to be billed. This unit will be billed in this step_size blocks.</param>
 public PriceComponent(DimensionType Type,
                       Decimal Price,
                       UInt32 StepSize = 1)
 {
     this.Type     = Type;
     this.Price    = Price;
     this.StepSize = StepSize;
 }
Esempio n. 7
0
 protected Dimension(double value, UnitOfMeasure unitOfMeasure)
 {
     Guard.NotNull(unitOfMeasure, "unitOfMeasure");
     _dimensionType = unitOfMeasure.DimensionType;
     _currentValue = value;
     _currentUnits = unitOfMeasure;
     _baseUnitsValue = _currentUnits.UnitConverter.ToBaseUnit(value);
 }
Esempio n. 8
0
 public virtual void OnCalculateRelayoutSize(DimensionType dimension)
 {
     Interop.CustomActorImpl.CustomActorImpl_OnCalculateRelayoutSize(swigCPtr, (int)dimension);
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 9
0
 public virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension)
 {
     Interop.CustomActorImpl.CustomActorImpl_OnSetResizePolicy(swigCPtr, (int)policy, (int)dimension);
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 10
0
        public void UpdateDimensionType(DimensionType dimensionType)
        {
            var command = new UpdateDimensionTypeCommand
            {
                DimensionType = dimensionType
            };

            processXml.Process(command.ToXml());
        }
Esempio n. 11
0
        /// <summary>
        /// Calculates the number of bytes to which this accessors reads
        /// taking into account if the source <see cref="BufferView"/> is strided.
        /// </summary>
        /// <returns>The number of bytes to access.</returns>
        internal int GetAccessorByteLength(DimensionType dim, EncodingType enc, int count)
        {
            var elementByteSize = dim.DimCount() * enc.ByteLength();

            if (this.ByteStride == 0)
            {
                return(elementByteSize * count);
            }
            return((this.ByteStride * (count - 1)) + elementByteSize);
        }
Esempio n. 12
0
        public Geometry Read()
        {
            //Initialize reader
            m_index = 0;

            m_endian = BitConverter.ToBoolean(extractBytes(m_index, 1, ref m_index), 0) ? EndianType.LITTLE_ENDIAN : EndianType.BIG_ENDIAN;
            DimensionType dimension = DimensionTypeExtensions.Parse(ReadNextInt(), out GeometryType geometryType);

            return(Read(geometryType, dimension));
        }
Esempio n. 13
0
        public virtual bool RelayoutDependentOnChildren(DimensionType dimension)
        {
            bool ret = Interop.CustomActorImpl.RelayoutDependentOnChildren(SwigCPtr, (int)dimension);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 14
0
 public ChatComune() : base()
 {
     InitializeComponent();
     _testo         = new List <String>();
     _displayHeight = 200;
     _displayWidth  = 50;
     _heightType    = DimensionType.Pixel;
     _widthType     = DimensionType.Percent;
     init();
 }
Esempio n. 15
0
 /// <summary>
 /// Changes the elements of this <c>IntersectionMatrix</c> to <c>dimensionValue</c>.
 /// </summary>
 /// <param name="dimensionValue">
 /// The dimension value to which to set this <c>IntersectionMatrix</c>
 /// s elements. Possible values <c>True, False, Dontcare, 0, 1, 2}</c>.
 /// </param>
 public void SetAll(DimensionType dimensionValue)
 {
     for (int ai = 0; ai < 3; ai++)
     {
         for (int bi = 0; bi < 3; bi++)
         {
             _matrix[ai, bi] = dimensionValue;
         }
     }
 }
Esempio n. 16
0
        internal ResizePolicyType GetResizePolicy(DimensionType dimension)
        {
            ResizePolicyType ret = (ResizePolicyType)Interop.Actor.Actor_GetResizePolicy(swigCPtr, (int)dimension);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 17
0
        /// <summary>
        /// Return the amount of size allocated for relayout.
        /// </summary>
        /// <param name="dimension">The dimension to retrieve.</param>
        /// <returns>Return the size.</returns>
        /// <since_tizen> 3 </since_tizen>
        public float GetRelayoutSize(DimensionType dimension)
        {
            float ret = Interop.Actor.GetRelayoutSize(SwigCPtr, (int)dimension);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 18
0
        public float CalculateChildSizeBase(View child, DimensionType dimension)
        {
            float ret = Interop.ViewWrapperImpl.ViewWrapperImpl_CalculateChildSizeBase(swigCPtr, View.getCPtr(child), (int)dimension);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 19
0
        public virtual float CalculateChildSize(View child, DimensionType dimension)
        {
            float ret = Interop.CustomActorImpl.CalculateChildSize(SwigCPtr, View.getCPtr(child), (int)dimension);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 20
0
        public bool RelayoutDependentOnChildrenBase(DimensionType dimension)
        {
            bool ret = Interop.ViewWrapperImpl.RelayoutDependentOnChildrenBase(SwigCPtr, (int)dimension);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 21
0
        public DimensionTypeWrapper(DimensionType dt)
        {
            Name = dt.Name;
            Id   = dt.Id;
            Type = dt.StyleType.ToString();
#if RELEASE2018
            IsUsingProjectUnits = dt.GetUnitsFormatOptions().UseDefault;
#else
            IsUsingProjectUnits = null;
#endif
        }
Esempio n. 22
0
        void setupBase <T>(DimensionType dimension, GeometryType geometry) where T : Geometry, new()
        {
            this.Type      = geometry;
            this.Dimension = dimension;
            m_arr          = new BinaryArray();
            m_arr.AddBytes(intToBytes((int)this.Type + (int)dimension));

            this.wkt        = geometry.ToString() + " " + dimension.WktEncode() + "(";
            this.ewkt       = "SRID=4326;" + this.Type.ToString() + " " + dimension.WktEncode() + "(";
            this.Validation = new T();
        }
Esempio n. 23
0
        public void Dimelement(Document doc, DimensionType dimensionType, View view)
        {
            Dictionary <string, List <Grid> > dic = GridCollection(doc, view);

            foreach (var item in dic.Keys)
            {
                ReferenceArray referenceArray  = new ReferenceArray();
                ReferenceArray referenceArray2 = new ReferenceArray();
                foreach (var item2 in dic[item])
                {
                    referenceArray.Append(GetGridReference(doc.ActiveView, item2));
                }
                referenceArray2.Append(GetGridReference(doc.ActiveView, dic[item].First()));
                referenceArray2.Append(GetGridReference(doc.ActiveView, dic[item].Last()));
                var  p1     = GetGridDirection(doc.ActiveView, dic[item].First());
                var  p2     = GetGridDirection(doc.ActiveView, dic[item].Last());
                var  r1     = p1.CrossProduct(doc.ActiveView.ViewDirection);
                var  curve  = dic[item].First().Curve;
                var  curve2 = dic[item].Last().Curve;
                Line line1  = curve as Line;
                if (line1.Direction.Equalpoint(doc.ActiveView.RightDirection))
                {
                    XYZ  point  = Findpointdimension(curve.GetEndPoint(0), p1, 450, view);
                    XYZ  point2 = Findpointdimension(curve2.GetEndPoint(0), p2, 450, view);
                    XYZ  point3 = Findpointdimension(curve.GetEndPoint(0), p1, 200, view);
                    XYZ  point4 = Findpointdimension(curve2.GetEndPoint(0), p2, 200, view);
                    Line line   = Line.CreateBound(point, point2);
                    Line line2  = Line.CreateBound(point3, point4);
                    using (Transaction tran = new Transaction(doc, "Create dimesion"))
                    {
                        tran.Start();
                        doc.Create.NewDimension(doc.ActiveView, line, referenceArray, dimensionType);
                        doc.Create.NewDimension(doc.ActiveView, line2, referenceArray2, dimensionType);
                        tran.Commit();
                    }
                }
                if (line1.Direction.Equalpoint(doc.ActiveView.UpDirection))
                {
                    XYZ  point  = Findpointdimension(curve.GetEndPoint(0), p1, 450, view);
                    XYZ  point2 = Findpointdimension(curve2.GetEndPoint(0), p2, 450, view);
                    XYZ  point3 = Findpointdimension(curve.GetEndPoint(0), p1, 200, view);
                    XYZ  point4 = Findpointdimension(curve2.GetEndPoint(0), p2, 200, view);
                    Line line   = Line.CreateBound(point, point2);
                    Line line2  = Line.CreateBound(point3, point4);
                    using (Transaction tran = new Transaction(doc, "Create dimesion"))
                    {
                        tran.Start();
                        doc.Create.NewDimension(doc.ActiveView, line, referenceArray, dimensionType);
                        doc.Create.NewDimension(doc.ActiveView, line2, referenceArray2, dimensionType);
                        tran.Commit();
                    }
                }
            }
        }
Esempio n. 24
0
 public void SetDimension(DimensionType dim, float value)
 {
     if (dim == DimensionType.Width)
     {
         Width = value;
     }
     else
     {
         Height = value;
     }
 }
Esempio n. 25
0
        public DimensionType ReadDimensionType(string dimensionTypeCode)
        {
            var command = new ReadDimensionTypeCommand
            {
                Office            = session.Office,
                DimensionTypeCode = dimensionTypeCode
            };
            var response = processXml.Process(command.ToXml());

            return(DimensionType.FromXml(response));
        }
Esempio n. 26
0
 public void SetMeasuredDimension(DimensionType dim, float value)
 {
     if (dim == DimensionType.Width)
     {
         MeasuredWidth = value;
     }
     else
     {
         MeasuredHeight = value;
     }
 }
Esempio n. 27
0
 /// <summary>
 /// Set dimension by dimension type
 /// </summary>
 /// <param name="aDim">a dimension</param>
 /// <param name="dimType">dimension type</param>
 public void SetDimension(Dimension aDim, DimensionType dimType)
 {
     if (aDim.DimType != dimType)
     {
         return;
     }
     else
     {
         SetDimension(aDim);
     }
 }
Esempio n. 28
0
 public void handleDimensionUpdate(int new_val, DimensionType type)
 {
     if (type == DimensionType.ScrollAmount)
     {
         scroll = new_val;
     }
     else if (type == DimensionType.ScreenHeight)
     {
         screen = new_val;
     }
 }
Esempio n. 29
0
 public void handleDimensionUpdate(int new_val, DimensionType type)
 {
     if (type == DimensionType.ScrollAmount)
     {
         scroll_amount = new_val;
     }
     else if (type == DimensionType.PageWidth)
     {
         current_left = new_val;
     }
 }
Esempio n. 30
0
        public MultiPoint ReadMultiPoint(DimensionType dimension)
        {
            string[]   points     = readGroup('(', ')', m_buffer, ref m_currIndex).Split(',');
            MultiPoint multiPoint = new MultiPoint();

            foreach (string pt in points)
            {
                multiPoint.AddGeometry(ReadCoordinate(dimension, pt));
            }

            return(multiPoint);
        }
Esempio n. 31
0
        public LineString ReadLineString(DimensionType dimension)
        {
            string[]   linePoints = readGroup('(', ')', m_buffer, ref m_currIndex).Split(',');
            LineString line       = new LineString();

            foreach (string pt in linePoints)
            {
                line.AddGeometry(ReadCoordinate(dimension, pt));
            }

            return(line);
        }
Esempio n. 32
0
 public void handleDimensionUpdate(int new_height, DimensionType type)
 {
     if (type != DimensionType.ScreenHeight)
     {
         return;
     }
     if (new_height > screen_height)
     {
         changeDimension(Math.Max(new_height, prev_value));
     }
     screen_height = new_height;
 }
Esempio n. 33
0
 /// <summary>
 /// Initializes a new instance of the <c>Dimension</c> class.
 /// </summary>
 protected Dimension(DimensionType type)
     : base(EntityType.Dimension, DxfObjectCode.Dimension)
 {
     this.definitionPoint  = Vector3.Zero;
     this.midTextPoint     = Vector3.Zero;
     this.dimensionType    = type;
     this.attachmentPoint  = MTextAttachmentPoint.MiddleCenter;
     this.lineSpacingStyle = MTextLineSpacingStyle.AtLeast;
     this.lineSpacing      = 1.0;
     this.block            = null;
     this.style            = DimensionStyle.Default;
 }
Esempio n. 34
0
 public bool CheckBoundaries(int input, DimensionType dimension)
 {
     if (input <= 0 || input > 10)
     {
         _communicator.Write(string.Format(MessageResources.CheckBoundariesError, dimension));
         return(false);
     }
     else
     {
         return(true);
     }
 }
Esempio n. 35
0
 /// <summary>
 /// Initializes a new instance of the <c>Dimension</c> class.
 /// </summary>
 protected Dimension(DimensionType type)
     : base(EntityType.Dimension, DxfObjectCode.Dimension)
 {
     this.definitionPoint = Vector3.Zero;
     this.midTextPoint = Vector3.Zero;
     this.dimensionType = type;
     this.attachmentPoint = MTextAttachmentPoint.MiddleCenter;
     this.lineSpacingStyle = MTextLineSpacingStyle.AtLeast;
     this.lineSpacing = 1.0;
     this.block = null;
     this.style = DimensionStyle.Default;
     this.userText = null;
     this.elevation = 0.0;
     this.styleOverrides = new DimensionStyleOverrideDictionary();
     this.styleOverrides.BeforeAddItem += this.StyleOverrides_BeforeAddItem;
     this.styleOverrides.AddItem += this.StyleOverrides_AddItem;
     this.styleOverrides.BeforeRemoveItem += this.StyleOverrides_BeforeRemoveItem;
     this.styleOverrides.RemoveItem += this.StyleOverrides_RemoveItem;
 }
Esempio n. 36
0
 /// <summary>
 /// Converts the dimension value to a dimension symbol,
 /// for example, <c>True => 'T'</c>
 /// </summary>
 /// <param name="dimensionValue">Number that can be stored in the <c>IntersectionMatrix</c>.
 /// Possible values are <c>True, False, Dontcare, 0, 1, 2</c>.</param>
 /// <returns>Character for use in the string representation of an <c>IntersectionMatrix</c>.
 /// Possible values are <c>T, F, *, 0, 1, 2</c>.</returns>
 public static char ToDimensionSymbol(DimensionType dimensionValue)
 {
     switch (dimensionValue)
     {
         case DimensionType.False:
             return 'F';
         case DimensionType.True:
             return 'T';
         case DimensionType.Dontcare:
             return '*';
         case DimensionType.Point:
             return '0';
         case DimensionType.Curve:
             return '1';
         case DimensionType.Surface:
             return '2';
         default:
             throw new ArgumentOutOfRangeException("Unknown dimension value: " + dimensionValue);
     }
 }
Esempio n. 37
0
 static Kick(DimensionType dim, JointType jnt, StatType stat, TimeType tm, FeatureType ftr)
 {
 }
Esempio n. 38
0
        /// <summary>
        /// Converts a common INE Dimension and its categories to a Dimension and DimensionAttributes.
        /// </summary>
        /// <param name="ineDimension"></param>
        /// <param name="order"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public static Dimension ToDimension(this INEService.Dimension ineDimension, int order, DimensionType type = DimensionType.Other)
        {
            // build dimensions hierarchy
            List<DimensionAttribute> attributes = new List<DimensionAttribute>();
            if (ineDimension.Categories != null) {

                // iterate through all hierarchy levels
                for (int hierarchyLevel = 1; hierarchyLevel <= ineDimension.LowestClassificationLevel; ++hierarchyLevel)
                {
                    // for each hierarchy level, get the categories from that level
                    IEnumerable<INEService.Category> categories = ineDimension.Categories.Where(c => c.Level == hierarchyLevel);
                    foreach (var category in categories)
                    {
                        // check if this category has other categories inside. check ParentCategoryId from all categories
                        bool hierarchy = ineDimension.Categories.Where(c => c.ParentCategoryCode == category.Code).FirstOrDefault() != null;
                        DimensionAttribute attribute = category.ToDimensionAttribute(hierarchy);

                        // Add categories to hierarchy.
                        // If does not have ParentCategory its a root, otherwise, find the parent category and add it to hierarchy.
                        if (string.IsNullOrEmpty(category.ParentCategoryCode))
                            attributes.Add(attribute);
                        else
                        {
                            //HierarchyAttribute attrHierarchy = (HierarchyAttribute)attributes.Where(a => a.ID == category.ParentCategoryCode).FirstOrDefault();
                            //attrHierarchy.AddAttribute(attribute);

                            HierarchyAttribute attrHierarchy = (HierarchyAttribute)attributes.GetDimensionAttributeById(category.ParentCategoryCode);
                            attrHierarchy.AddAttribute(attribute);
                        }

                    }
                }
            }

            return new Dimension {
                ID = order.ToString(),
                DimensionType = type,
                Name = ineDimension.Designation,
                NameAbbr = ineDimension.Abbreviation,
                Attributes = attributes
            };
        }
Esempio n. 39
0
 public Dimension(DimensionType type, decimal value)
 {
     Value = value;
     Type = type;
 }
 public UnitOfMeasureLookup(DimensionType dimensionType)
 {
     _dimensionType = dimensionType;
 }
Esempio n. 41
0
 /// <summary>
 /// Changes the specified element to <c>minimumDimensionValue</c> if the
 /// element is less.
 /// </summary>
 /// <param name="row">
 /// The row of this <c>IntersectionMatrix</c>
 ///, indicating the interior, boundary or exterior of the first <c>Geometry</c>.
 /// </param>
 /// <param name="column">
 /// The column of this <c>IntersectionMatrix</c>
 ///, indicating the interior, boundary or exterior of the second <c>Geometry</c>.
 /// </param>
 /// <param name="minimumDimensionValue">
 /// The dimension value with which to compare the
 /// element. The order of dimension values from least to greatest is
 /// <c>True, False, Dontcare, 0, 1, 2</c>.
 /// </param>
 public virtual void SetAtLeast(LocationType row, LocationType column, DimensionType minimumDimensionValue)
 {
     if (_matrix[(int)row, (int)column] < minimumDimensionValue)
         _matrix[(int)row, (int)column] = minimumDimensionValue;
 }
            public Dimension(Guid dimensionID, DimensionType dimensionType)
            {
                Assert.IsNotNull(dimensionID, "dimensionID");

                DimensionID = dimensionID;
                DimensionType = dimensionType;
            }
Esempio n. 43
0
        private void Stream(ArrayList data, DimensionType dimType)
        {
            data.Add(new Snoop.Data.ClassSeparator(typeof(DimensionType)));

             // No data at this level yet!

             SpotDimensionType spotDimType = dimType as SpotDimensionType;
             if (spotDimType != null)
             {
            Stream(data, spotDimType);
            return;
             }
        }
Esempio n. 44
0
 /// <summary>
 /// Returns true if the dimension value satisfies the dimension symbol.
 /// </summary>
 /// <param name="actualDimensionValue">
 /// A number that can be stored in the <c>IntersectionMatrix</c>
 /// . Possible values are <c>True, False, Dontcare, 0, 1, 2</c>.
 /// </param>
 /// <param name="requiredDimensionSymbol">
 /// A character used in the string
 /// representation of an <c>IntersectionMatrix</c>. Possible values
 /// are <c>T, F, *, 0, 1, 2</c>.
 /// </param>
 /// <returns>
 /// True if the dimension symbol encompasses
 /// the dimension value.
 /// </returns>
 public static bool Matches(DimensionType actualDimensionValue, char requiredDimensionSymbol)
 {
     if (requiredDimensionSymbol == '*')
         return true;
     if (requiredDimensionSymbol == 'T' && (actualDimensionValue >= DimensionType.Point ||
                                            actualDimensionValue == DimensionType.True))
         return true;
     if (requiredDimensionSymbol == 'F' && actualDimensionValue == DimensionType.False)
         return true;
     if (requiredDimensionSymbol == '0' && actualDimensionValue == DimensionType.Point)
         return true;
     if (requiredDimensionSymbol == '1' && actualDimensionValue == DimensionType.Curve)
         return true;
     if (requiredDimensionSymbol == '2' && actualDimensionValue == DimensionType.Surface)
         return true;
     return false;
 }
Esempio n. 45
0
 /// <summary>
 /// Create new CDR dimension object.
 /// </summary>
 /// <param name="Type">Type of cdr dimension.</param>
 /// <param name="Volume">Volume of the dimension consumed, measured according to the dimension type.</param>
 public CDRDimension(DimensionType  Type,
                     Decimal        Volume)
 {
     this._Type    = Type;
     this._Volume  = Volume;
 }
Esempio n. 46
0
        /// <summary>
        /// Returns <c>true</c> if this <c>IntersectionMatrix</c> is T*F**FFF*.
        /// </summary>
        /// <param name="dimensionOfGeometryA">The dimension of the first <c>Geometry</c>.</param>
        /// <param name="dimensionOfGeometryB">The dimension of the second <c>Geometry</c>.</param>
        /// <returns>
        /// <c>true</c> if the two <c>Geometry</c>
        /// s related by this <c>IntersectionMatrix</c> are equal; the
        /// <c>Geometry</c>s must have the same dimension for this function
        /// to return <c>true</c>.
        /// </returns>
        public virtual bool IsEquals(DimensionType dimensionOfGeometryA, DimensionType dimensionOfGeometryB)
        {
            if (dimensionOfGeometryA != dimensionOfGeometryB)
                return false;

            return Matches(_matrix[(int)LocationType.Interior, (int)LocationType.Interior], 'T') &&
                _matrix[(int)LocationType.Exterior, (int)LocationType.Interior] == DimensionType.False &&
                _matrix[(int)LocationType.Interior, (int)LocationType.Exterior] == DimensionType.False &&
                _matrix[(int)LocationType.Exterior, (int)LocationType.Boundary] == DimensionType.False &&
                _matrix[(int)LocationType.Boundary, (int)LocationType.Exterior] == DimensionType.False;
        }
Esempio n. 47
0
        /// <summary>
        /// Returns <c>true</c> if this <c>IntersectionMatrix</c> is
        /// FT*******, F**T***** or F***T****.
        /// </summary>
        /// <param name="dimensionOfGeometryA">The dimension of the first <c>Geometry</c>.</param>
        /// <param name="dimensionOfGeometryB">The dimension of the second <c>Geometry</c>.</param>
        /// <returns>
        /// <c>true</c> if the two <c>Geometry</c>
        /// s related by this <c>IntersectionMatrix</c> touch; Returns false
        /// if both <c>Geometry</c>s are points.
        /// </returns>
        public virtual bool IsTouches(DimensionType dimensionOfGeometryA, DimensionType dimensionOfGeometryB)
        {
            if (dimensionOfGeometryA > dimensionOfGeometryB)
                //no need to get transpose because pattern matrix is symmetrical
                return IsTouches(dimensionOfGeometryB, dimensionOfGeometryA);

            if ((dimensionOfGeometryA == DimensionType.Surface && dimensionOfGeometryB == DimensionType.Surface) ||
                (dimensionOfGeometryA == DimensionType.Curve && dimensionOfGeometryB == DimensionType.Curve) ||
                (dimensionOfGeometryA == DimensionType.Curve && dimensionOfGeometryB == DimensionType.Surface) ||
                (dimensionOfGeometryA == DimensionType.Point && dimensionOfGeometryB == DimensionType.Surface) ||
                (dimensionOfGeometryA == DimensionType.Point && dimensionOfGeometryB == DimensionType.Curve))
                return _matrix[(int)LocationType.Interior, (int)LocationType.Interior] == DimensionType.False &&
                        (Matches(_matrix[(int)LocationType.Interior, (int)LocationType.Boundary], 'T') ||
                         Matches(_matrix[(int)LocationType.Boundary, (int)LocationType.Interior], 'T') ||
                         Matches(_matrix[(int)LocationType.Boundary, (int)LocationType.Boundary], 'T'));

            return false;
        }
Esempio n. 48
0
 /// <summary>
 /// Changes the elements of this <c>IntersectionMatrix</c> to <c>dimensionValue</c>.
 /// </summary>
 /// <param name="dimensionValue">
 /// The dimension value to which to set this <c>IntersectionMatrix</c>
 /// s elements. Possible values <c>True, False, Dontcare, 0, 1, 2}</c>.
 /// </param>
 public void SetAll(DimensionType dimensionValue)
 {
     for (int ai = 0; ai < 3; ai++)
         for (int bi = 0; bi < 3; bi++)
             _matrix[ai, bi] = dimensionValue;
 }
Esempio n. 49
0
 /// <summary>
 /// If row >= 0 and column >= 0, changes the specified element to <c>minimumDimensionValue</c>
 /// if the element is less. Does nothing if row is smaller to 0 or column is smaller to 0.
 /// </summary>
 /// <param name="row"></param>
 /// <param name="column"></param>
 /// <param name="minimumDimensionValue"></param>
 public virtual void SetAtLeastIfValid(LocationType row, LocationType column, DimensionType minimumDimensionValue)
 {
     if (row >= LocationType.Interior && column >= LocationType.Interior)
         SetAtLeast(row, column, minimumDimensionValue);
 }
Esempio n. 50
0
 static SideStep(DimensionType dim, JointType jnt, StatType stat, TimeType tm, FeatureType ftr)
 {
 }
Esempio n. 51
0
 /// <summary>
 /// Initializes a new instance of the <c>Dimension</c> class.
 /// </summary>
 protected Dimension(DimensionType type)
     : base(EntityType.Dimension, DxfObjectCode.Dimension)
 {
     this.definitionPoint = Vector3.Zero;
     this.midTextPoint = Vector3.Zero;
     this.dimensionType = type;
     this.attachmentPoint = MTextAttachmentPoint.MiddleCenter;
     this.lineSpacingStyle = MTextLineSpacingStyle.AtLeast;
     this.lineSpacing = 1.0;
     this.block = null;
     this.style = DimensionStyle.Default;
     this.userText = null;
 }
 public static void ShouldBe(this DimensionType actual, DimensionType expected)
 {
     if (actual != expected) {
         throw new Exception(string.Format("Cannot convert '{0}Unit' to '{1}Unit'.", actual, expected));
     }
 }
 public UnitOfMeasure this[DimensionType dimensionType]
 {
     get { return _unitPreferences[dimensionType]; }
 }
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2.1 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="DimensionCore"/> class.
        /// </summary>
        /// <param name="dimension">
        /// The dimension. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        /// <param name="position0">
        /// The position 0. 
        /// </param>
        public DimensionCore(DimensionType dimension, IDimensionList parent, int position0)
            : base(dimension, SdmxStructureType.GetFromEnum(SdmxStructureEnumType.Dimension), parent)
        {
            this.conceptRole = new List<ICrossReference>();
            if (dimension.position.HasValue)
            {
                this.position = dimension.position.Value;
            }
            else
            {
                this.position = position0;
            }

            if (ObjectUtil.ValidCollection(dimension.ConceptRole))
            {
                foreach (ConceptReferenceType conceptReference in dimension.ConceptRole)
                {
                    this.conceptRole.Add(RefUtil.CreateReference(this, conceptReference));
                }
            }

            this.ValidateDimension();
        }
Esempio n. 55
0
        /// <summary>
        /// Returns <c>true</c> if this <c>IntersectionMatrix</c> is
        ///  T*T***T** (for two points or two surfaces)
        ///  1*T***T** (for two curves).
        /// </summary>
        /// <param name="dimensionOfGeometryA">The dimension of the first <c>Geometry</c>.</param>
        /// <param name="dimensionOfGeometryB">The dimension of the second <c>Geometry</c>.</param>
        /// <returns>
        /// <c>true</c> if the two <c>Geometry</c>
        /// s related by this <c>IntersectionMatrix</c> overlap. For this
        /// function to return <c>true</c>, the <c>Geometry</c>s must
        /// be two points, two curves or two surfaces.
        /// </returns>
        public virtual bool IsOverlaps(DimensionType dimensionOfGeometryA, DimensionType dimensionOfGeometryB)
        {
            if ((dimensionOfGeometryA == DimensionType.Point && dimensionOfGeometryB == DimensionType.Point) ||
                (dimensionOfGeometryA == DimensionType.Surface && dimensionOfGeometryB == DimensionType.Surface))
                return Matches(_matrix[(int)LocationType.Interior, (int)LocationType.Interior], 'T') &&
                       Matches(_matrix[(int)LocationType.Interior, (int)LocationType.Exterior], 'T') &&
                       Matches(_matrix[(int)LocationType.Exterior, (int)LocationType.Interior], 'T');

            if (dimensionOfGeometryA == DimensionType.Curve && dimensionOfGeometryB == DimensionType.Curve)
                return _matrix[(int)LocationType.Interior, (int)LocationType.Interior] == DimensionType.Curve &&
                       Matches(_matrix[(int)LocationType.Interior, (int)LocationType.Exterior], 'T') &&
                       Matches(_matrix[(int)LocationType.Exterior, (int)LocationType.Interior], 'T');

            return false;
        }
Esempio n. 56
0
 /// <summary>
 /// Changes the value of one of this <c>IntersectionMatrix</c>s
 /// elements.
 /// </summary>
 /// <param name="row">
 /// The row of this <c>IntersectionMatrix</c>,
 /// indicating the interior, boundary or exterior of the first <c>Geometry</c>
 /// </param>
 /// <param name="column">
 /// The column of this <c>IntersectionMatrix</c>,
 /// indicating the interior, boundary or exterior of the second <c>Geometry</c>
 /// </param>
 /// <param name="dimensionValue">
 /// The new value of the element
 /// </param>
 public virtual void Set(LocationType row, LocationType column, DimensionType dimensionValue)
 {
     _matrix[(int)row, (int)column] = dimensionValue;
 }