/// <summary>
        /// Reads incoming Json and parses it to the right implementation
        /// </summary>
        /// <param name="reader">Reader that has json</param>
        /// <param name="objectType">objectType to which should be converted</param>
        /// <param name="existingValue">A potentially existing value</param>
        /// <param name="serializer">Serializer that is in use</param>
        /// <returns>parsed object</returns>
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var jsonObject = JObject.Load(reader);
            //logger.Debug(objectType);
            var graphItemType = default(object);

            if (objectType == typeof(IVertex))
            {
                graphItemType = new Vertex();
            }
            else if (objectType == typeof(IEdge))
            {
                graphItemType = new Edge();
            }
            else if (objectType == typeof(IVertexValue))
            {
                graphItemType = new VertexValue();
            }
            else if (objectType == typeof(IVertexProperties))
            {
                graphItemType = new VertexProperties();
            }
            else if (objectType == typeof(IEdgeProperties))
            {
                graphItemType = new EdgeProperties();
            }
            else
            {
                throw (new Exceptions.NotSupportedDatabaseException("Not supported GraphDatabase. Titan or OrientDB are supported."));
            }

            serializer.Populate(jsonObject.CreateReader(), graphItemType);
            return(graphItemType);
        }
 internal override void Populate(string property)
 {
     if (ProjectedProperties.Contains(property))
     {
         return;
     }
     VertexProperties.Add(new GremlinProperty(GremlinKeyword.PropertyCardinality.list, property, null, null));
     base.Populate(property);
 }
示例#3
0
 internal override void Populate(string property)
 {
     if (ProjectedProperties.Contains(property))
     {
         return;
     }
     VertexProperties.Add(property);
     VertexProperties.Add(null);
     base.Populate(property);
 }
示例#4
0
 public EngineCollisionPoint(
     Vector3d dist,
     VertexProperties a,
     VertexProperties b,
     Vector3d normal)
 {
     this.Dist   = dist;
     this.A      = a;
     this.B      = b;
     this.Normal = normal;
 }
示例#5
0
        public static VertexProperties[] SetVertexPosition(IGeometry obj)
        {
            VertexProperties[] vertexPosition = new VertexProperties[obj.BaseGeometry.VerticesIdx.Length];

            for (int i = 0; i < obj.BaseGeometry.VerticesIdx.Length; i++)
            {
                vertexPosition[i] = CommonUtilities.GetVertexPosition(obj, i);
            }

            return(vertexPosition);
        }
 internal override void Property(GremlinToSqlContext currentContext, GremlinProperty vertexProperty)
 {
     vertexProperty.Cardinality = GremlinKeyword.PropertyCardinality.list;
     if (PropertyFromAddVParameters.ContainsKey(vertexProperty.Key))
     {
         foreach (var property in PropertyFromAddVParameters[vertexProperty.Key])
         {
             VertexProperties.Remove(property);
         }
     }
     ProjectedProperties.Add(vertexProperty.Key);
     VertexProperties.Add(vertexProperty);
 }
示例#7
0
        public static VertexProperties[] SetVertexPosition(
            IGeometry obj,
            Vector3d[] vertices)
        {
            VertexProperties[] vertexPosition = new VertexProperties[obj.BaseGeometry.VerticesIdx.Length];

            for (int i = 0; i < obj.BaseGeometry.VerticesIdx.Length; i++)
            {
                vertexPosition[i] = new VertexProperties(vertices[obj.BaseGeometry.VerticesIdx[i].ID], obj.BaseGeometry.VerticesIdx[i].GetLocalAdjacencyList());
            }

            return(vertexPosition);
        }
示例#8
0
 public CollisionPoint(
     VertexProperties collisionPointA,
     VertexProperties collisionPointB,
     Vector3d collisionNormal,
     double distance,
     bool intersection)
 {
     CollisionPointA = collisionPointA;
     CollisionPointB = collisionPointB;
     CollisionNormal = collisionNormal;
     Distance        = distance;
     Intersection    = intersection;
 }
示例#9
0
 internal override void Property(GremlinToSqlContext currentContext, List <object> properties)
 {
     ProjectedProperties.Add(properties.First() as string);
     VertexProperties.AddRange(properties);
 }
示例#10
0
 public void SetB(VertexProperties b)
 {
     this.B = b;
 }
示例#11
0
 public void SetA(VertexProperties a)
 {
     this.A = a;
 }