Example #1
0
 public RelationConfigBuilder(
     ReferenceConfiguration <TKey> refConfig,
     IEntityPropertyConfigBuilder <TDb, TKey, TEntity, TProp> parentBuilder)
 {
     _refConfig     = refConfig;
     _parentBuilder = parentBuilder;
 }
Example #2
0
        /// <summary>
        /// Modifies the transforms of the content internal to this catalog to use
        /// the orientation of the reference instances that exist.
        /// </summary>
        public void UseReferenceOrientation()
        {
            if (ReferenceConfiguration == null)
            {
                return;
            }

            foreach (var content in Content)
            {
                var refInstance = ReferenceConfiguration.FirstOrDefault(r => ((ElementInstance)r).BaseDefinition.Id == content.Id) as ElementInstance;
                if (refInstance == null)
                {
                    continue;
                }
                // Use reference instance to set the rotation, but not the position of the original elements.
                var referenceOrientation = refInstance.Transform.Concatenated(new Geometry.Transform(refInstance.Transform.Origin.Negate()));
                content.Transform = referenceOrientation;
            }
        }